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 XFA_FXJSE_INCLUDE_FXJSE_H_ | 7 #ifndef XFA_FXJSE_INCLUDE_FXJSE_H_ |
8 #define XFA_FXJSE_INCLUDE_FXJSE_H_ | 8 #define XFA_FXJSE_INCLUDE_FXJSE_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_string.h" | 10 #include "core/fxcrt/include/fx_string.h" |
11 #include "core/fxcrt/include/fx_system.h" | 11 #include "core/fxcrt/include/fx_system.h" |
12 #include "v8/include/v8.h" | 12 #include "v8/include/v8.h" |
13 | 13 |
14 struct FXJSE_CLASS; | |
15 class CFXJSE_Arguments; | 14 class CFXJSE_Arguments; |
| 15 class CFXJSE_Context; |
16 | 16 |
17 typedef struct FXJSE_HCONTEXT_ { void* pData; } * FXJSE_HCONTEXT; | |
18 typedef struct FXJSE_HCLASS_ { void* pData; } * FXJSE_HCLASS; | 17 typedef struct FXJSE_HCLASS_ { void* pData; } * FXJSE_HCLASS; |
19 typedef struct FXJSE_HVALUE_ { void* pData; } * FXJSE_HVALUE; | 18 typedef struct FXJSE_HVALUE_ { void* pData; } * FXJSE_HVALUE; |
20 // NOLINTNEXTLINE | 19 // NOLINTNEXTLINE |
21 typedef struct FXJSE_HOBJECT_ : public FXJSE_HVALUE_{} * FXJSE_HOBJECT; | 20 typedef struct FXJSE_HOBJECT_ : public FXJSE_HVALUE_{} * FXJSE_HOBJECT; |
22 | 21 |
23 typedef void (*FXJSE_FuncCallback)(FXJSE_HOBJECT hThis, | 22 typedef void (*FXJSE_FuncCallback)(FXJSE_HOBJECT hThis, |
24 const CFX_ByteStringC& szFuncName, | 23 const CFX_ByteStringC& szFuncName, |
25 CFXJSE_Arguments& args); | 24 CFXJSE_Arguments& args); |
26 typedef void (*FXJSE_PropAccessor)(FXJSE_HOBJECT hObject, | 25 typedef void (*FXJSE_PropAccessor)(FXJSE_HOBJECT hObject, |
27 const CFX_ByteStringC& szPropName, | 26 const CFX_ByteStringC& szPropName, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 FXJSE_PropDeleter dynPropDeleter; | 66 FXJSE_PropDeleter dynPropDeleter; |
68 FXJSE_FuncCallback dynMethodCall; | 67 FXJSE_FuncCallback dynMethodCall; |
69 }; | 68 }; |
70 | 69 |
71 void FXJSE_Initialize(); | 70 void FXJSE_Initialize(); |
72 void FXJSE_Finalize(); | 71 void FXJSE_Finalize(); |
73 | 72 |
74 v8::Isolate* FXJSE_Runtime_Create(); | 73 v8::Isolate* FXJSE_Runtime_Create(); |
75 void FXJSE_Runtime_Release(v8::Isolate* pIsolate, bool bOwnedRuntime); | 74 void FXJSE_Runtime_Release(v8::Isolate* pIsolate, bool bOwnedRuntime); |
76 | 75 |
77 FXJSE_HCONTEXT FXJSE_Context_Create(v8::Isolate* pIsolate, | 76 CFXJSE_Context* FXJSE_Context_Create(v8::Isolate* pIsolate, |
78 const FXJSE_CLASS* lpGlobalClass = nullptr, | 77 const FXJSE_CLASS* lpGlobalClass = nullptr, |
79 void* lpGlobalObject = nullptr); | 78 void* lpGlobalObject = nullptr); |
80 void FXJSE_Context_Release(FXJSE_HCONTEXT hContext); | 79 void FXJSE_Context_Release(CFXJSE_Context* pContext); |
81 FXJSE_HVALUE FXJSE_Context_GetGlobalObject(FXJSE_HCONTEXT hContext); | 80 FXJSE_HVALUE FXJSE_Context_GetGlobalObject(CFXJSE_Context* pContext); |
82 | 81 |
83 void FXJSE_Context_EnableCompatibleMode(FXJSE_HCONTEXT hContext, | 82 void FXJSE_Context_EnableCompatibleMode(CFXJSE_Context* pContext, |
84 uint32_t dwCompatibleFlags); | 83 uint32_t dwCompatibleFlags); |
85 | 84 |
86 FXJSE_HCLASS FXJSE_DefineClass(FXJSE_HCONTEXT hContext, | 85 FXJSE_HCLASS FXJSE_DefineClass(CFXJSE_Context* pContext, |
87 const FXJSE_CLASS* lpClass); | 86 const FXJSE_CLASS* lpClass); |
88 | 87 |
89 FXJSE_HVALUE FXJSE_Value_Create(v8::Isolate* pIsolate); | 88 FXJSE_HVALUE FXJSE_Value_Create(v8::Isolate* pIsolate); |
90 void FXJSE_Value_Release(FXJSE_HVALUE hValue); | 89 void FXJSE_Value_Release(FXJSE_HVALUE hValue); |
91 | 90 |
92 FX_BOOL FXJSE_Value_IsUndefined(FXJSE_HVALUE hValue); | 91 FX_BOOL FXJSE_Value_IsUndefined(FXJSE_HVALUE hValue); |
93 FX_BOOL FXJSE_Value_IsNull(FXJSE_HVALUE hValue); | 92 FX_BOOL FXJSE_Value_IsNull(FXJSE_HVALUE hValue); |
94 FX_BOOL FXJSE_Value_IsBoolean(FXJSE_HVALUE hValue); | 93 FX_BOOL FXJSE_Value_IsBoolean(FXJSE_HVALUE hValue); |
95 FX_BOOL FXJSE_Value_IsUTF8String(FXJSE_HVALUE hValue); | 94 FX_BOOL FXJSE_Value_IsUTF8String(FXJSE_HVALUE hValue); |
96 FX_BOOL FXJSE_Value_IsNumber(FXJSE_HVALUE hValue); | 95 FX_BOOL FXJSE_Value_IsNumber(FXJSE_HVALUE hValue); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 const CFX_ByteStringC& szPropName, | 135 const CFX_ByteStringC& szPropName, |
137 FX_BOOL bUseTypeGetter); | 136 FX_BOOL bUseTypeGetter); |
138 FX_BOOL FXJSE_Value_SetObjectOwnProp(FXJSE_HVALUE hValue, | 137 FX_BOOL FXJSE_Value_SetObjectOwnProp(FXJSE_HVALUE hValue, |
139 const CFX_ByteStringC& szPropName, | 138 const CFX_ByteStringC& szPropName, |
140 FXJSE_HVALUE hPropValue); | 139 FXJSE_HVALUE hPropValue); |
141 | 140 |
142 FX_BOOL FXJSE_Value_SetFunctionBind(FXJSE_HVALUE hValue, | 141 FX_BOOL FXJSE_Value_SetFunctionBind(FXJSE_HVALUE hValue, |
143 FXJSE_HVALUE hOldFunction, | 142 FXJSE_HVALUE hOldFunction, |
144 FXJSE_HVALUE hNewThis); | 143 FXJSE_HVALUE hNewThis); |
145 | 144 |
146 FX_BOOL FXJSE_ExecuteScript(FXJSE_HCONTEXT hContext, | 145 FX_BOOL FXJSE_ExecuteScript(CFXJSE_Context* pContext, |
147 const FX_CHAR* szScript, | 146 const FX_CHAR* szScript, |
148 FXJSE_HVALUE hRetValue, | 147 FXJSE_HVALUE hRetValue, |
149 FXJSE_HVALUE hNewThisObject = nullptr); | 148 FXJSE_HVALUE hNewThisObject = nullptr); |
150 | 149 |
151 void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name, | 150 void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name, |
152 const CFX_ByteStringC& utf8Message); | 151 const CFX_ByteStringC& utf8Message); |
153 | 152 |
154 #endif // XFA_FXJSE_INCLUDE_FXJSE_H_ | 153 #endif // XFA_FXJSE_INCLUDE_FXJSE_H_ |
OLD | NEW |