summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-15 15:42:31 -0400
committerDan Sinclair <dsinclair@chromium.org>2016-03-15 15:42:31 -0400
commit3a8051c8cb55e3c108c1f860dc743c42827ae4fa (patch)
treea74f6fe441e57669f7b25766f1d724e8ef8ed0d4
parent56c1019e694ba9c2d6624d3c11d99c22798ffdc8 (diff)
downloadpdfium-3a8051c8cb55e3c108c1f860dc743c42827ae4fa.tar.xz
Move xfa/include/fxjse/fxjse.h into xfa/fxjse/include.
This CL moves the fxjse.h header and splits the cfxjse_arguments.h into its own file. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1807623002 .
-rw-r--r--BUILD.gn3
-rw-r--r--fpdfsdk/include/javascript/DEPS3
-rw-r--r--fpdfsdk/include/javascript/IJavaScript.h2
-rw-r--r--xfa.gyp3
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jsapi.h2
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jscontext.cpp1
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jscontext.h1
-rw-r--r--xfa/fxfa/parser/xfa_object.h1
-rw-r--r--xfa/fxfa/parser/xfa_object_imp.cpp1
-rw-r--r--xfa/fxfa/parser/xfa_script_datawindow.cpp1
-rw-r--r--xfa/fxfa/parser/xfa_script_datawindow.h1
-rw-r--r--xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp1
-rw-r--r--xfa/fxfa/parser/xfa_script_eventpseudomodel.h1
-rw-r--r--xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp1
-rw-r--r--xfa/fxfa/parser/xfa_script_hostpseudomodel.h1
-rw-r--r--xfa/fxfa/parser/xfa_script_imp.cpp1
-rw-r--r--xfa/fxfa/parser/xfa_script_imp.h1
-rw-r--r--xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp1
-rw-r--r--xfa/fxfa/parser/xfa_script_layoutpseudomodel.h1
-rw-r--r--xfa/fxfa/parser/xfa_script_logpseudomodel.cpp1
-rw-r--r--xfa/fxfa/parser/xfa_script_logpseudomodel.h1
-rw-r--r--xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp1
-rw-r--r--xfa/fxfa/parser/xfa_script_signaturepseudomodel.h1
-rw-r--r--xfa/fxjse/cfxjse_arguments.h25
-rw-r--r--xfa/fxjse/class.cpp1
-rw-r--r--xfa/fxjse/class.h3
-rw-r--r--xfa/fxjse/context.h2
-rw-r--r--xfa/fxjse/dynprop.cpp1
-rw-r--r--xfa/fxjse/include/fxjse.h (renamed from xfa/include/fxjse/fxjse.h)89
-rw-r--r--xfa/include/fxfa/fxfa_basic.h3
30 files changed, 106 insertions, 49 deletions
diff --git a/BUILD.gn b/BUILD.gn
index bfb1b1265a..a08970868e 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1349,6 +1349,7 @@ if (pdf_enable_xfa) {
"xfa/fxgraphics/fx_path_generator.cpp",
"xfa/fxgraphics/fx_path_generator.h",
"xfa/fxgraphics/pre.h",
+ "xfa/fxjse/include/fxjse.h",
"xfa/include/fwl/adapter/fwl_adapternative.h",
"xfa/include/fwl/adapter/fwl_adapterthreadmgr.h",
"xfa/include/fwl/adapter/fwl_adaptertimermgr.h",
@@ -1417,11 +1418,11 @@ if (pdf_enable_xfa) {
"xfa/include/fxfa/fxfa_objectacc.h",
"xfa/include/fxfa/fxfa_widget.h",
"xfa/include/fxgraphics/fx_graphics.h",
- "xfa/include/fxjse/fxjse.h",
]
include_dirs = [ "." ]
if (pdf_enable_v8) {
sources += [
+ "xfa/fxjse/cfxjse_arguments.h",
"xfa/fxjse/class.cpp",
"xfa/fxjse/class.h",
"xfa/fxjse/context.cpp",
diff --git a/fpdfsdk/include/javascript/DEPS b/fpdfsdk/include/javascript/DEPS
new file mode 100644
index 0000000000..2846bdc69c
--- /dev/null
+++ b/fpdfsdk/include/javascript/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ '+xfa/fxjse/include'
+]
diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h
index 6b154676da..319634882f 100644
--- a/fpdfsdk/include/javascript/IJavaScript.h
+++ b/fpdfsdk/include/javascript/IJavaScript.h
@@ -11,7 +11,7 @@
#include "core/include/fxcrt/fx_system.h"
#ifdef PDF_ENABLE_XFA
-#include "xfa/include/fxjse/fxjse.h"
+#include "xfa/fxjse/include/fxjse.h"
#endif // PDF_ENABLE_XFA
class CPDFDoc_Environment;
diff --git a/xfa.gyp b/xfa.gyp
index 78593dfa6d..80ece87d1a 100644
--- a/xfa.gyp
+++ b/xfa.gyp
@@ -103,7 +103,6 @@
"xfa/include/fxfa/fxfa_objectacc.h",
"xfa/include/fxfa/fxfa_widget.h",
"xfa/include/fxgraphics/fx_graphics.h",
- "xfa/include/fxjse/fxjse.h",
"xfa/fde/css/fde_css.h",
"xfa/fde/css/fde_csscache.cpp",
"xfa/fde/css/fde_csscache.h",
@@ -642,6 +641,7 @@
"xfa/fxgraphics/fx_path_generator.cpp",
"xfa/fxgraphics/fx_path_generator.h",
"xfa/fxgraphics/pre.h",
+ "xfa/fxjse/include/fxjse.h",
],
"conditions": [
["clang==1" , {
@@ -658,6 +658,7 @@
'<(DEPTH)/v8/include',
],
'sources': [
+ "xfa/fxjse/cfxjse_arguments.h",
"xfa/fxjse/class.cpp",
"xfa/fxjse/class.h",
"xfa/fxjse/context.cpp",
diff --git a/xfa/fxfa/fm2js/xfa_fm2jsapi.h b/xfa/fxfa/fm2js/xfa_fm2jsapi.h
index 246bc8f255..41f54642e3 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jsapi.h
+++ b/xfa/fxfa/fm2js/xfa_fm2jsapi.h
@@ -9,7 +9,7 @@
#include "core/include/fxcrt/fx_basic.h"
#include "xfa/fxfa/parser/xfa_document.h"
-#include "xfa/include/fxjse/fxjse.h"
+#include "xfa/fxjse/include/fxjse.h"
#define FOXIT_XFA_FM2JS_FORMCALC_RUNTIME "foxit_xfa_formcalc_runtime"
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
index 9de6e1c9f4..f2576b00d4 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -14,6 +14,7 @@
#include "xfa/fxfa/parser/xfa_document.h"
#include "xfa/fxfa/parser/xfa_localevalue.h"
#include "xfa/fxfa/parser/xfa_parser.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
#define FINANCIAL_PRECISION 0.00000001
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.h b/xfa/fxfa/fm2js/xfa_fm2jscontext.h
index c80d9881a0..b35d135912 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.h
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.h
@@ -8,6 +8,7 @@
#define XFA_FXFA_FM2JS_XFA_FM2JSCONTEXT_H_
#include "xfa/fxfa/parser/xfa_script.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
class CXFA_FM2JSContext {
public:
diff --git a/xfa/fxfa/parser/xfa_object.h b/xfa/fxfa/parser/xfa_object.h
index 1dba00166f..96dfeee39e 100644
--- a/xfa/fxfa/parser/xfa_object.h
+++ b/xfa/fxfa/parser/xfa_object.h
@@ -9,6 +9,7 @@
#include "xfa/fde/xml/fde_xml.h"
#include "xfa/fxfa/parser/xfa_utils.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
class CXFA_Document;
class CXFA_Node;
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index 83bf800c1a..f65e304066 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -19,6 +19,7 @@
#include "xfa/fxfa/parser/xfa_parser.h"
#include "xfa/fxfa/parser/xfa_script.h"
#include "xfa/fxfa/parser/xfa_utils.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
CXFA_Object::CXFA_Object(CXFA_Document* pDocument, FX_DWORD uFlags)
: m_pDocument(pDocument), m_uFlags(uFlags) {}
diff --git a/xfa/fxfa/parser/xfa_script_datawindow.cpp b/xfa/fxfa/parser/xfa_script_datawindow.cpp
index 9c771e6ffa..c3383938fc 100644
--- a/xfa/fxfa/parser/xfa_script_datawindow.cpp
+++ b/xfa/fxfa/parser/xfa_script_datawindow.cpp
@@ -15,6 +15,7 @@
#include "xfa/fxfa/parser/xfa_parser.h"
#include "xfa/fxfa/parser/xfa_script.h"
#include "xfa/fxfa/parser/xfa_utils.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
CScript_DataWindow::CScript_DataWindow(CXFA_Document* pDocument)
: CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_DataWindow) {
diff --git a/xfa/fxfa/parser/xfa_script_datawindow.h b/xfa/fxfa/parser/xfa_script_datawindow.h
index 9974e11eb1..515bb99b2e 100644
--- a/xfa/fxfa/parser/xfa_script_datawindow.h
+++ b/xfa/fxfa/parser/xfa_script_datawindow.h
@@ -8,6 +8,7 @@
#define XFA_FXFA_PARSER_XFA_SCRIPT_DATAWINDOW_H_
#include "xfa/fxfa/parser/xfa_object.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
class CScript_DataWindow : public CXFA_OrdinaryObject {
public:
diff --git a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
index 4e1cb22dd3..5282019f70 100644
--- a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
@@ -15,6 +15,7 @@
#include "xfa/fxfa/parser/xfa_parser.h"
#include "xfa/fxfa/parser/xfa_script.h"
#include "xfa/fxfa/parser/xfa_utils.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
CScript_EventPseudoModel::CScript_EventPseudoModel(CXFA_Document* pDocument)
: CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_EventPseudoModel) {
diff --git a/xfa/fxfa/parser/xfa_script_eventpseudomodel.h b/xfa/fxfa/parser/xfa_script_eventpseudomodel.h
index e1db83a182..54f26b2b70 100644
--- a/xfa/fxfa/parser/xfa_script_eventpseudomodel.h
+++ b/xfa/fxfa/parser/xfa_script_eventpseudomodel.h
@@ -8,6 +8,7 @@
#define XFA_FXFA_PARSER_XFA_SCRIPT_EVENTPSEUDOMODEL_H_
#include "xfa/fxfa/parser/xfa_object.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
#define XFA_EVENT_CHANGE 0
#define XFA_EVENT_COMMITKEY 1
diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
index 1f5886bf4e..4165790ed7 100644
--- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
@@ -15,6 +15,7 @@
#include "xfa/fxfa/parser/xfa_parser.h"
#include "xfa/fxfa/parser/xfa_script.h"
#include "xfa/fxfa/parser/xfa_utils.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
CScript_HostPseudoModel::CScript_HostPseudoModel(CXFA_Document* pDocument)
: CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_HostPseudoModel) {
diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.h b/xfa/fxfa/parser/xfa_script_hostpseudomodel.h
index dcc2a9bf7d..0f711b8948 100644
--- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.h
+++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.h
@@ -9,6 +9,7 @@
#include "xfa/fxfa/parser/xfa_document.h"
#include "xfa/fxfa/parser/xfa_object.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
class CScript_HostPseudoModel : public CXFA_OrdinaryObject {
public:
diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp
index 275f4944fc..c49bb31a70 100644
--- a/xfa/fxfa/parser/xfa_script_imp.cpp
+++ b/xfa/fxfa/parser/xfa_script_imp.cpp
@@ -18,6 +18,7 @@
#include "xfa/fxfa/parser/xfa_script_nodehelper.h"
#include "xfa/fxfa/parser/xfa_script_resolveprocessor.h"
#include "xfa/fxfa/parser/xfa_utils.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
CXFA_ScriptContext::CXFA_ScriptContext(CXFA_Document* pDocument)
: m_pDocument(pDocument),
diff --git a/xfa/fxfa/parser/xfa_script_imp.h b/xfa/fxfa/parser/xfa_script_imp.h
index e4b5501770..ab225eb54d 100644
--- a/xfa/fxfa/parser/xfa_script_imp.h
+++ b/xfa/fxfa/parser/xfa_script_imp.h
@@ -12,6 +12,7 @@
#include "xfa/fxfa/fm2js/xfa_fm2jsapi.h"
#include "xfa/fxfa/parser/xfa_document.h"
#include "xfa/fxfa/parser/xfa_script.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
#define XFA_RESOLVENODE_TagName 0x0002
diff --git a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp
index d4a4ea8021..97f2c8b45d 100644
--- a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp
@@ -17,6 +17,7 @@
#include "xfa/fxfa/parser/xfa_parser.h"
#include "xfa/fxfa/parser/xfa_script.h"
#include "xfa/fxfa/parser/xfa_utils.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
CScript_LayoutPseudoModel::CScript_LayoutPseudoModel(CXFA_Document* pDocument)
: CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_LayoutPseudoModel) {
diff --git a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.h b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.h
index 349a3cc96d..56d9894284 100644
--- a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.h
+++ b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.h
@@ -9,6 +9,7 @@
#include "xfa/fxfa/parser/xfa_doclayout.h"
#include "xfa/fxfa/parser/xfa_object.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
enum XFA_LAYOUTMODEL_HWXY {
XFA_LAYOUTMODEL_H,
diff --git a/xfa/fxfa/parser/xfa_script_logpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_logpseudomodel.cpp
index 01f94c5414..f2d7f1aaf8 100644
--- a/xfa/fxfa/parser/xfa_script_logpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_logpseudomodel.cpp
@@ -15,6 +15,7 @@
#include "xfa/fxfa/parser/xfa_parser.h"
#include "xfa/fxfa/parser/xfa_script.h"
#include "xfa/fxfa/parser/xfa_utils.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
CScript_LogPseudoModel::CScript_LogPseudoModel(CXFA_Document* pDocument)
: CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_LogPseudoModel) {
diff --git a/xfa/fxfa/parser/xfa_script_logpseudomodel.h b/xfa/fxfa/parser/xfa_script_logpseudomodel.h
index 8cd7c23a49..e7138fe142 100644
--- a/xfa/fxfa/parser/xfa_script_logpseudomodel.h
+++ b/xfa/fxfa/parser/xfa_script_logpseudomodel.h
@@ -8,6 +8,7 @@
#define XFA_FXFA_PARSER_XFA_SCRIPT_LOGPSEUDOMODEL_H_
#include "xfa/fxfa/parser/xfa_object.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
class CScript_LogPseudoModel : public CXFA_OrdinaryObject {
public:
diff --git a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp
index ee33eb21ff..15328b0ce3 100644
--- a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp
@@ -15,6 +15,7 @@
#include "xfa/fxfa/parser/xfa_parser.h"
#include "xfa/fxfa/parser/xfa_script.h"
#include "xfa/fxfa/parser/xfa_utils.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
CScript_SignaturePseudoModel::CScript_SignaturePseudoModel(
CXFA_Document* pDocument)
diff --git a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.h b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.h
index 2591917c0d..5ca6df1d91 100644
--- a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.h
+++ b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.h
@@ -8,6 +8,7 @@
#define XFA_FXFA_PARSER_XFA_SCRIPT_SIGNATUREPSEUDOMODEL_H_
#include "xfa/fxfa/parser/xfa_object.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
class CScript_SignaturePseudoModel : public CXFA_OrdinaryObject {
public:
diff --git a/xfa/fxjse/cfxjse_arguments.h b/xfa/fxjse/cfxjse_arguments.h
new file mode 100644
index 0000000000..b38d0772c0
--- /dev/null
+++ b/xfa/fxjse/cfxjse_arguments.h
@@ -0,0 +1,25 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef XFA_FXJSE_CFXJSE_ARGUMENTS_H_
+#define XFA_FXJSE_CFXJSE_ARGUMENTS_H_
+
+#include "xfa/fxjse/include/fxjse.h"
+
+class CFXJSE_Arguments {
+ public:
+ FXJSE_HRUNTIME GetRuntime() const;
+ int32_t GetLength() const;
+ FXJSE_HVALUE GetValue(int32_t index) const;
+ FX_BOOL GetBoolean(int32_t index) const;
+ int32_t GetInt32(int32_t index) const;
+ FX_FLOAT GetFloat(int32_t index) const;
+ CFX_ByteString GetUTF8String(int32_t index) const;
+ void* GetObject(int32_t index, FXJSE_HCLASS hClass = nullptr) const;
+ FXJSE_HVALUE GetReturnValue();
+};
+
+#endif // XFA_FXJSE_CFXJSE_ARGUMENTS_H_
diff --git a/xfa/fxjse/class.cpp b/xfa/fxjse/class.cpp
index e87fbbfaf9..c93e0bc581 100644
--- a/xfa/fxjse/class.cpp
+++ b/xfa/fxjse/class.cpp
@@ -6,6 +6,7 @@
#include "xfa/fxjse/class.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
#include "xfa/fxjse/context.h"
#include "xfa/fxjse/scope_inline.h"
#include "xfa/fxjse/util_inline.h"
diff --git a/xfa/fxjse/class.h b/xfa/fxjse/class.h
index e67a77a5c3..db52979589 100644
--- a/xfa/fxjse/class.h
+++ b/xfa/fxjse/class.h
@@ -8,7 +8,8 @@
#define XFA_FXJSE_CLASS_H_
#include "v8/include/v8.h"
-#include "xfa/include/fxjse/fxjse.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
+#include "xfa/fxjse/include/fxjse.h"
class CFXJSE_Context;
class CFXJSE_Value;
diff --git a/xfa/fxjse/context.h b/xfa/fxjse/context.h
index 01a1f4b655..9d3700940c 100644
--- a/xfa/fxjse/context.h
+++ b/xfa/fxjse/context.h
@@ -9,7 +9,7 @@
#include "core/include/fxcrt/fx_basic.h"
#include "v8/include/v8.h"
-#include "xfa/include/fxjse/fxjse.h"
+#include "xfa/fxjse/include/fxjse.h"
class CFXJSE_Class;
class CFXJSE_Value;
diff --git a/xfa/fxjse/dynprop.cpp b/xfa/fxjse/dynprop.cpp
index 88cb0197bd..fc408ac000 100644
--- a/xfa/fxjse/dynprop.cpp
+++ b/xfa/fxjse/dynprop.cpp
@@ -4,6 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "xfa/fxjse/cfxjse_arguments.h"
#include "xfa/fxjse/class.h"
#include "xfa/fxjse/value.h"
diff --git a/xfa/include/fxjse/fxjse.h b/xfa/fxjse/include/fxjse.h
index b1074c38d5..d957c58651 100644
--- a/xfa/include/fxjse/fxjse.h
+++ b/xfa/fxjse/include/fxjse.h
@@ -4,13 +4,14 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_INCLUDE_FXJSE_FXJSE_H_
-#define XFA_INCLUDE_FXJSE_FXJSE_H_
+#ifndef XFA_FXJSE_INCLUDE_FXJSE_H_
+#define XFA_FXJSE_INCLUDE_FXJSE_H_
#include "core/include/fxcrt/fx_string.h"
#include "core/include/fxcrt/fx_system.h"
struct FXJSE_CLASS;
+class CFXJSE_Arguments;
typedef struct FXJSE_HRUNTIME_ { void* pData; } * FXJSE_HRUNTIME;
typedef struct FXJSE_HCONTEXT_ { void* pData; } * FXJSE_HCONTEXT;
@@ -20,35 +21,6 @@ typedef struct FXJSE_HVALUE_ { void* pData; } * FXJSE_HVALUE;
typedef struct FXJSE_HOBJECT_ : public FXJSE_HVALUE_{} * FXJSE_HOBJECT;
typedef double FXJSE_DOUBLE;
-void FXJSE_Initialize();
-void FXJSE_Finalize();
-FXJSE_HRUNTIME FXJSE_Runtime_Create();
-void FXJSE_Runtime_Release(FXJSE_HRUNTIME hRuntime, bool bOwnedRuntime);
-
-FXJSE_HCONTEXT FXJSE_Context_Create(FXJSE_HRUNTIME hRuntime,
- const FXJSE_CLASS* lpGlobalClass = nullptr,
- void* lpGlobalObject = nullptr);
-void FXJSE_Context_Release(FXJSE_HCONTEXT hContext);
-FXJSE_HVALUE FXJSE_Context_GetGlobalObject(FXJSE_HCONTEXT hContext);
-FXJSE_HRUNTIME FXJSE_Context_GetRuntime(FXJSE_HCONTEXT hContext);
-enum FXJSE_CompatibleModeFlags {
- FXJSE_COMPATIBLEMODEFLAG_CONSTRUCTOREXTRAMETHODS = (1 << 0),
- FXJSE_COMPATIBLEMODEFLAGCOUNT = 1,
-};
-void FXJSE_Context_EnableCompatibleMode(FXJSE_HCONTEXT hContext,
- FX_DWORD dwCompatibleFlags);
-class CFXJSE_Arguments {
- public:
- FXJSE_HRUNTIME GetRuntime() const;
- int32_t GetLength() const;
- FXJSE_HVALUE GetValue(int32_t index) const;
- FX_BOOL GetBoolean(int32_t index) const;
- int32_t GetInt32(int32_t index) const;
- FX_FLOAT GetFloat(int32_t index) const;
- CFX_ByteString GetUTF8String(int32_t index) const;
- void* GetObject(int32_t index, FXJSE_HCLASS hClass = nullptr) const;
- FXJSE_HVALUE GetReturnValue();
-};
typedef void (*FXJSE_FuncCallback)(FXJSE_HOBJECT hThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
@@ -60,25 +32,29 @@ typedef int32_t (*FXJSE_PropTypeGetter)(FXJSE_HOBJECT hObject,
FX_BOOL bQueryIn);
typedef FX_BOOL (*FXJSE_PropDeleter)(FXJSE_HOBJECT hObject,
const CFX_ByteStringC& szPropName);
+
+enum FXJSE_ClassPropTypes {
+ FXJSE_ClassPropType_None,
+ FXJSE_ClassPropType_Property,
+ FXJSE_ClassPropType_Method
+};
+
+enum FXJSE_CompatibleModeFlags {
+ FXJSE_COMPATIBLEMODEFLAG_CONSTRUCTOREXTRAMETHODS = (1 << 0),
+ FXJSE_COMPATIBLEMODEFLAGCOUNT = 1,
+};
+
struct FXJSE_FUNCTION {
const FX_CHAR* name;
FXJSE_FuncCallback callbackProc;
};
-#define FXJSE_DEF_FUNCTION(functionName, functionCallback) \
- { functionName, functionCallback }
-void FXJSE_DefineFunctions(FXJSE_HCONTEXT hContext,
- const FXJSE_FUNCTION* lpFunctions,
- int nNum);
+
struct FXJSE_PROPERTY {
const FX_CHAR* name;
FXJSE_PropAccessor getProc;
FXJSE_PropAccessor setProc;
};
-enum FXJSE_ClassPropTypes {
- FXJSE_ClassPropType_None,
- FXJSE_ClassPropType_Property,
- FXJSE_ClassPropType_Method
-};
+
struct FXJSE_CLASS {
const FX_CHAR* name;
FXJSE_FuncCallback constructor;
@@ -92,13 +68,35 @@ struct FXJSE_CLASS {
FXJSE_PropDeleter dynPropDeleter;
FXJSE_FuncCallback dynMethodCall;
};
+
+void FXJSE_Initialize();
+void FXJSE_Finalize();
+
+FXJSE_HRUNTIME FXJSE_Runtime_Create();
+void FXJSE_Runtime_Release(FXJSE_HRUNTIME hRuntime, bool bOwnedRuntime);
+
+FXJSE_HCONTEXT FXJSE_Context_Create(FXJSE_HRUNTIME hRuntime,
+ const FXJSE_CLASS* lpGlobalClass = nullptr,
+ void* lpGlobalObject = nullptr);
+void FXJSE_Context_Release(FXJSE_HCONTEXT hContext);
+FXJSE_HVALUE FXJSE_Context_GetGlobalObject(FXJSE_HCONTEXT hContext);
+FXJSE_HRUNTIME FXJSE_Context_GetRuntime(FXJSE_HCONTEXT hContext);
+
+void FXJSE_Context_EnableCompatibleMode(FXJSE_HCONTEXT hContext,
+ FX_DWORD dwCompatibleFlags);
+
+void FXJSE_DefineFunctions(FXJSE_HCONTEXT hContext,
+ const FXJSE_FUNCTION* lpFunctions,
+ int nNum);
FXJSE_HCLASS FXJSE_DefineClass(FXJSE_HCONTEXT hContext,
const FXJSE_CLASS* lpClass);
FXJSE_HCLASS FXJSE_GetClass(FXJSE_HCONTEXT hContext,
const CFX_ByteStringC& szName);
+
FXJSE_HVALUE FXJSE_Value_Create(FXJSE_HRUNTIME hRuntime);
void FXJSE_Value_Release(FXJSE_HVALUE hValue);
FXJSE_HRUNTIME FXJSE_Value_GetRuntime(FXJSE_HVALUE hValue);
+
FX_BOOL FXJSE_Value_IsUndefined(FXJSE_HVALUE hValue);
FX_BOOL FXJSE_Value_IsNull(FXJSE_HVALUE hValue);
FX_BOOL FXJSE_Value_IsBoolean(FXJSE_HVALUE hValue);
@@ -109,12 +107,14 @@ FX_BOOL FXJSE_Value_IsObject(FXJSE_HVALUE hValue);
FX_BOOL FXJSE_Value_IsArray(FXJSE_HVALUE hValue);
FX_BOOL FXJSE_Value_IsFunction(FXJSE_HVALUE hValue);
FX_BOOL FXJSE_Value_IsDate(FXJSE_HVALUE hValue);
+
FX_BOOL FXJSE_Value_ToBoolean(FXJSE_HVALUE hValue);
FX_FLOAT FXJSE_Value_ToFloat(FXJSE_HVALUE hValue);
FXJSE_DOUBLE FXJSE_Value_ToDouble(FXJSE_HVALUE hValue);
int32_t FXJSE_Value_ToInteger(FXJSE_HVALUE hValue);
void FXJSE_Value_ToUTF8String(FXJSE_HVALUE hValue, CFX_ByteString& szStrOutput);
void* FXJSE_Value_ToObject(FXJSE_HVALUE hValue, FXJSE_HCLASS hClass);
+
void FXJSE_Value_SetUndefined(FXJSE_HVALUE hValue);
void FXJSE_Value_SetNull(FXJSE_HVALUE hValue);
void FXJSE_Value_SetBoolean(FXJSE_HVALUE hValue, FX_BOOL bBoolean);
@@ -131,6 +131,7 @@ void FXJSE_Value_SetArray(FXJSE_HVALUE hValue,
FXJSE_HVALUE* rgValues);
void FXJSE_Value_SetDate(FXJSE_HVALUE hValue, FXJSE_DOUBLE dDouble);
void FXJSE_Value_Set(FXJSE_HVALUE hValue, FXJSE_HVALUE hOriginalValue);
+
FX_BOOL FXJSE_Value_GetObjectProp(FXJSE_HVALUE hValue,
const CFX_ByteStringC& szPropName,
FXJSE_HVALUE hPropValue);
@@ -151,6 +152,7 @@ FX_BOOL FXJSE_Value_ObjectHasOwnProp(FXJSE_HVALUE hValue,
FX_BOOL FXJSE_Value_SetObjectOwnProp(FXJSE_HVALUE hValue,
const CFX_ByteStringC& szPropName,
FXJSE_HVALUE hPropValue);
+
FX_BOOL FXJSE_Value_CallFunction(FXJSE_HVALUE hFunction,
FXJSE_HVALUE hThis,
FXJSE_HVALUE hRetValue,
@@ -159,12 +161,15 @@ FX_BOOL FXJSE_Value_CallFunction(FXJSE_HVALUE hFunction,
FX_BOOL FXJSE_Value_SetFunctionBind(FXJSE_HVALUE hValue,
FXJSE_HVALUE hOldFunction,
FXJSE_HVALUE hNewThis);
+
FX_BOOL FXJSE_ExecuteScript(FXJSE_HCONTEXT hContext,
const FX_CHAR* szScript,
FXJSE_HVALUE hRetValue,
FXJSE_HVALUE hNewThisObject = nullptr);
+
void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name,
const CFX_ByteStringC& utf8Message);
+
FX_BOOL FXJSE_ReturnValue_GetMessage(FXJSE_HVALUE hRetValue,
CFX_ByteString& utf8Name,
CFX_ByteString& utf8Message);
@@ -172,4 +177,4 @@ FX_BOOL FXJSE_ReturnValue_GetLineInfo(FXJSE_HVALUE hRetValue,
int32_t& nLine,
int32_t& nCol);
-#endif // XFA_INCLUDE_FXJSE_FXJSE_H_
+#endif // XFA_FXJSE_INCLUDE_FXJSE_H_
diff --git a/xfa/include/fxfa/fxfa_basic.h b/xfa/include/fxfa/fxfa_basic.h
index a93cb455ae..dba3522dc4 100644
--- a/xfa/include/fxfa/fxfa_basic.h
+++ b/xfa/include/fxfa/fxfa_basic.h
@@ -7,7 +7,8 @@
#ifndef XFA_INCLUDE_FXFA_FXFA_BASIC_H_
#define XFA_INCLUDE_FXFA_FXFA_BASIC_H_
-#include "xfa/include/fxjse/fxjse.h"
+#include "xfa/fxjse/cfxjse_arguments.h"
+#include "xfa/fxjse/include/fxjse.h"
class CXFA_Measurement;
#define XFA_HASHCODE_Xfa 0xc56b9ff