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 // PDFium wrapper around V8 APIs. PDFium code should include this file rather | 7 // PDFium wrapper around V8 APIs. PDFium code should include this file rather |
8 // than including V8 headers directly. | 8 // than including V8 headers directly. |
9 | 9 |
10 #ifndef FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ | 10 #ifndef FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ |
11 #define FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ | 11 #define FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ |
12 | 12 |
13 #include <v8.h> | 13 #include <v8.h> |
14 #include "../../../core/include/fxcrt/fx_basic.h" | 14 #include "../../../core/include/fxcrt/fx_basic.h" |
15 | 15 |
16 // FXJS_V8 places no interpretation on these two classes; it merely | 16 // FXJS_V8 places no interpretation on these two classes; it merely |
17 // passes them on to the caller-provided FXJS_CONSTRUCTORs. | 17 // passes them on to the caller-provided FXJS_CONSTRUCTORs. |
18 class IFXJS_Context; | 18 class IFXJS_Context; |
19 class IFXJS_Runtime; | 19 class IFXJS_Runtime; |
20 | 20 |
21 enum FXJSOBJTYPE { | 21 enum FXJSOBJTYPE { |
22 FXJS_DYNAMIC = 0, | 22 FXJSOBJTYPE_DYNAMIC = 0, // Created by native method and returned to JS. |
23 FXJS_STATIC = 1, | 23 FXJSOBJTYPE_STATIC, // Created by init and hung off of global object. |
| 24 FXJSOBJTYPE_GLOBAL, // The global object itself (may only appear once). |
24 }; | 25 }; |
25 | 26 |
26 struct FXJSErr { | 27 struct FXJSErr { |
27 const wchar_t* message; | 28 const wchar_t* message; |
28 const wchar_t* srcline; | 29 const wchar_t* srcline; |
29 unsigned linnum; | 30 unsigned linnum; |
30 }; | 31 }; |
31 | 32 |
32 class FXJS_PerIsolateData { | 33 class FXJS_PerIsolateData { |
33 public: | 34 public: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 IFXJS_Context* pJSContext, | 121 IFXJS_Context* pJSContext, |
121 const wchar_t* script, | 122 const wchar_t* script, |
122 long length, | 123 long length, |
123 FXJSErr* perror); | 124 FXJSErr* perror); |
124 | 125 |
125 v8::Local<v8::Object> FXJS_NewFxDynamicObj(v8::Isolate* pIsolate, | 126 v8::Local<v8::Object> FXJS_NewFxDynamicObj(v8::Isolate* pIsolate, |
126 IFXJS_Context* pJSContext, | 127 IFXJS_Context* pJSContext, |
127 int nObjDefnID); | 128 int nObjDefnID); |
128 v8::Local<v8::Object> FXJS_GetThisObj(v8::Isolate* pIsolate); | 129 v8::Local<v8::Object> FXJS_GetThisObj(v8::Isolate* pIsolate); |
129 int FXJS_GetObjDefnID(v8::Local<v8::Object> pObj); | 130 int FXJS_GetObjDefnID(v8::Local<v8::Object> pObj); |
130 int FXJS_GetObjDefnID(v8::Isolate* pIsolate, const wchar_t* pObjName); | |
131 v8::Isolate* FXJS_GetRuntime(v8::Local<v8::Object> pObj); | 131 v8::Isolate* FXJS_GetRuntime(v8::Local<v8::Object> pObj); |
132 const wchar_t* FXJS_GetTypeof(v8::Local<v8::Value> pObj); | 132 const wchar_t* FXJS_GetTypeof(v8::Local<v8::Value> pObj); |
133 | 133 |
134 void FXJS_SetPrivate(v8::Isolate* pIsolate, | 134 void FXJS_SetPrivate(v8::Isolate* pIsolate, |
135 v8::Local<v8::Object> pObj, | 135 v8::Local<v8::Object> pObj, |
136 void* p); | 136 void* p); |
137 void* FXJS_GetPrivate(v8::Isolate* pIsolate, v8::Local<v8::Object> pObj); | 137 void* FXJS_GetPrivate(v8::Isolate* pIsolate, v8::Local<v8::Object> pObj); |
138 void FXJS_FreePrivate(void* p); | 138 void FXJS_FreePrivate(void* p); |
139 void FXJS_FreePrivate(v8::Local<v8::Object> pObj); | 139 void FXJS_FreePrivate(v8::Local<v8::Object> pObj); |
140 | 140 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); | 205 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); |
206 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, | 206 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, |
207 v8::Local<v8::Value> pValue); | 207 v8::Local<v8::Value> pValue); |
208 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, | 208 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, |
209 v8::Local<v8::Value> pValue); | 209 v8::Local<v8::Value> pValue); |
210 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, | 210 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, |
211 v8::Local<v8::Value> pValue); | 211 v8::Local<v8::Value> pValue); |
212 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); | 212 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); |
213 | 213 |
214 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ | 214 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ |
OLD | NEW |