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 FPDFSDK_JAVASCRIPT_JS_DEFINE_H_ | 7 #ifndef FPDFSDK_JAVASCRIPT_JS_DEFINE_H_ |
8 #define FPDFSDK_JAVASCRIPT_JS_DEFINE_H_ | 8 #define FPDFSDK_JAVASCRIPT_JS_DEFINE_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "fpdfsdk/javascript/JS_Object.h" | 12 #include "fpdfsdk/javascript/JS_Object.h" |
13 #include "fpdfsdk/javascript/JS_Value.h" | 13 #include "fpdfsdk/javascript/JS_Value.h" |
14 #include "fpdfsdk/javascript/resource.h" | 14 #include "fpdfsdk/javascript/resource.h" |
15 #include "fxjs/include/fxjs_v8.h" | 15 #include "fxjs/fxjs_v8.h" |
16 | 16 |
17 struct JSConstSpec { | 17 struct JSConstSpec { |
18 const wchar_t* pName; | 18 const wchar_t* pName; |
19 double number; | 19 double number; |
20 const wchar_t* str; | 20 const wchar_t* str; |
21 uint8_t t; // 0:double 1:str | 21 uint8_t t; // 0:double 1:str |
22 }; | 22 }; |
23 | 23 |
24 struct JSPropertySpec { | 24 struct JSPropertySpec { |
25 const wchar_t* pName; | 25 const wchar_t* pName; |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 #define IMPLEMENT_JS_STATIC_GLOBAL_FUN(js_class_name) \ | 476 #define IMPLEMENT_JS_STATIC_GLOBAL_FUN(js_class_name) \ |
477 void js_class_name::DefineJSObjects(CFXJS_Engine* pEngine) { \ | 477 void js_class_name::DefineJSObjects(CFXJS_Engine* pEngine) { \ |
478 for (size_t i = 0; i < FX_ArraySize(global_methods) - 1; ++i) { \ | 478 for (size_t i = 0; i < FX_ArraySize(global_methods) - 1; ++i) { \ |
479 pEngine->DefineGlobalMethod( \ | 479 pEngine->DefineGlobalMethod( \ |
480 js_class_name::global_methods[i].pName, \ | 480 js_class_name::global_methods[i].pName, \ |
481 js_class_name::global_methods[i].pMethodCall); \ | 481 js_class_name::global_methods[i].pMethodCall); \ |
482 } \ | 482 } \ |
483 } | 483 } |
484 | 484 |
485 #endif // FPDFSDK_JAVASCRIPT_JS_DEFINE_H_ | 485 #endif // FPDFSDK_JAVASCRIPT_JS_DEFINE_H_ |
OLD | NEW |