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" |
(...skipping 21 matching lines...) Expand all Loading... |
32 FXJSE_ClassPropType_None, | 32 FXJSE_ClassPropType_None, |
33 FXJSE_ClassPropType_Property, | 33 FXJSE_ClassPropType_Property, |
34 FXJSE_ClassPropType_Method | 34 FXJSE_ClassPropType_Method |
35 }; | 35 }; |
36 | 36 |
37 enum FXJSE_CompatibleModeFlags { | 37 enum FXJSE_CompatibleModeFlags { |
38 FXJSE_COMPATIBLEMODEFLAG_CONSTRUCTOREXTRAMETHODS = (1 << 0), | 38 FXJSE_COMPATIBLEMODEFLAG_CONSTRUCTOREXTRAMETHODS = (1 << 0), |
39 FXJSE_COMPATIBLEMODEFLAGCOUNT = 1, | 39 FXJSE_COMPATIBLEMODEFLAGCOUNT = 1, |
40 }; | 40 }; |
41 | 41 |
42 struct FXJSE_FUNCTION { | 42 struct FXJSE_FUNCTION_DESCRIPTOR { |
43 const FX_CHAR* name; | 43 const FX_CHAR* name; |
44 FXJSE_FuncCallback callbackProc; | 44 FXJSE_FuncCallback callbackProc; |
45 }; | 45 }; |
46 | 46 |
47 struct FXJSE_PROPERTY { | 47 struct FXJSE_PROPERTY_DESCRIPTOR { |
48 const FX_CHAR* name; | 48 const FX_CHAR* name; |
49 FXJSE_PropAccessor getProc; | 49 FXJSE_PropAccessor getProc; |
50 FXJSE_PropAccessor setProc; | 50 FXJSE_PropAccessor setProc; |
51 }; | 51 }; |
52 | 52 |
53 struct FXJSE_CLASS { | 53 struct FXJSE_CLASS_DESCRIPTOR { |
54 const FX_CHAR* name; | 54 const FX_CHAR* name; |
55 FXJSE_FuncCallback constructor; | 55 FXJSE_FuncCallback constructor; |
56 FXJSE_PROPERTY* properties; | 56 FXJSE_PROPERTY_DESCRIPTOR* properties; |
57 FXJSE_FUNCTION* methods; | 57 FXJSE_FUNCTION_DESCRIPTOR* methods; |
58 int32_t propNum; | 58 int32_t propNum; |
59 int32_t methNum; | 59 int32_t methNum; |
60 FXJSE_PropTypeGetter dynPropTypeGetter; | 60 FXJSE_PropTypeGetter dynPropTypeGetter; |
61 FXJSE_PropAccessor dynPropGetter; | 61 FXJSE_PropAccessor dynPropGetter; |
62 FXJSE_PropAccessor dynPropSetter; | 62 FXJSE_PropAccessor dynPropSetter; |
63 FXJSE_PropDeleter dynPropDeleter; | 63 FXJSE_PropDeleter dynPropDeleter; |
64 FXJSE_FuncCallback dynMethodCall; | 64 FXJSE_FuncCallback dynMethodCall; |
65 }; | 65 }; |
66 | 66 |
67 void FXJSE_Initialize(); | 67 void FXJSE_Initialize(); |
68 void FXJSE_Finalize(); | 68 void FXJSE_Finalize(); |
69 | 69 |
70 v8::Isolate* FXJSE_Runtime_Create(); | 70 v8::Isolate* FXJSE_Runtime_Create(); |
71 void FXJSE_Runtime_Release(v8::Isolate* pIsolate, bool bOwnedRuntime); | 71 void FXJSE_Runtime_Release(v8::Isolate* pIsolate, bool bOwnedRuntime); |
72 | 72 |
73 CFXJSE_Context* FXJSE_Context_Create(v8::Isolate* pIsolate, | 73 CFXJSE_Context* FXJSE_Context_Create( |
74 const FXJSE_CLASS* lpGlobalClass = nullptr, | 74 v8::Isolate* pIsolate, |
75 void* lpGlobalObject = nullptr); | 75 const FXJSE_CLASS_DESCRIPTOR* lpGlobalClass = nullptr, |
| 76 void* lpGlobalObject = nullptr); |
76 void FXJSE_Context_Release(CFXJSE_Context* pContext); | 77 void FXJSE_Context_Release(CFXJSE_Context* pContext); |
77 CFXJSE_Value* FXJSE_Context_GetGlobalObject(CFXJSE_Context* pContext); | 78 CFXJSE_Value* FXJSE_Context_GetGlobalObject(CFXJSE_Context* pContext); |
78 | 79 |
79 void FXJSE_Context_EnableCompatibleMode(CFXJSE_Context* pContext, | 80 void FXJSE_Context_EnableCompatibleMode(CFXJSE_Context* pContext, |
80 uint32_t dwCompatibleFlags); | 81 uint32_t dwCompatibleFlags); |
81 | 82 |
82 CFXJSE_Class* FXJSE_DefineClass(CFXJSE_Context* pContext, | 83 CFXJSE_Class* FXJSE_DefineClass(CFXJSE_Context* pContext, |
83 const FXJSE_CLASS* lpClass); | 84 const FXJSE_CLASS_DESCRIPTOR* lpClass); |
84 | 85 |
85 CFXJSE_Value* FXJSE_Value_Create(v8::Isolate* pIsolate); | 86 CFXJSE_Value* FXJSE_Value_Create(v8::Isolate* pIsolate); |
86 void FXJSE_Value_Release(CFXJSE_Value* pValue); | 87 void FXJSE_Value_Release(CFXJSE_Value* pValue); |
87 | 88 |
88 FX_BOOL FXJSE_Value_IsUndefined(CFXJSE_Value* pValue); | 89 FX_BOOL FXJSE_Value_IsUndefined(CFXJSE_Value* pValue); |
89 FX_BOOL FXJSE_Value_IsNull(CFXJSE_Value* pValue); | 90 FX_BOOL FXJSE_Value_IsNull(CFXJSE_Value* pValue); |
90 FX_BOOL FXJSE_Value_IsBoolean(CFXJSE_Value* pValue); | 91 FX_BOOL FXJSE_Value_IsBoolean(CFXJSE_Value* pValue); |
91 FX_BOOL FXJSE_Value_IsUTF8String(CFXJSE_Value* pValue); | 92 FX_BOOL FXJSE_Value_IsUTF8String(CFXJSE_Value* pValue); |
92 FX_BOOL FXJSE_Value_IsNumber(CFXJSE_Value* pValue); | 93 FX_BOOL FXJSE_Value_IsNumber(CFXJSE_Value* pValue); |
93 FX_BOOL FXJSE_Value_IsObject(CFXJSE_Value* pValue); | 94 FX_BOOL FXJSE_Value_IsObject(CFXJSE_Value* pValue); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 143 |
143 FX_BOOL FXJSE_ExecuteScript(CFXJSE_Context* pContext, | 144 FX_BOOL FXJSE_ExecuteScript(CFXJSE_Context* pContext, |
144 const FX_CHAR* szScript, | 145 const FX_CHAR* szScript, |
145 CFXJSE_Value* pRetValue, | 146 CFXJSE_Value* pRetValue, |
146 CFXJSE_Value* pNewThisObject = nullptr); | 147 CFXJSE_Value* pNewThisObject = nullptr); |
147 | 148 |
148 void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name, | 149 void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name, |
149 const CFX_ByteStringC& utf8Message); | 150 const CFX_ByteStringC& utf8Message); |
150 | 151 |
151 #endif // XFA_FXJSE_INCLUDE_FXJSE_H_ | 152 #endif // XFA_FXJSE_INCLUDE_FXJSE_H_ |
OLD | NEW |