summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/javascript')
-rw-r--r--fpdfsdk/javascript/Field.cpp2
-rw-r--r--fpdfsdk/javascript/JS_Value.cpp2
-rw-r--r--fpdfsdk/javascript/app.cpp2
-rw-r--r--fpdfsdk/javascript/cjs_document.cpp (renamed from fpdfsdk/javascript/Document.cpp)55
-rw-r--r--fpdfsdk/javascript/cjs_document.h (renamed from fpdfsdk/javascript/Document.h)42
-rw-r--r--fpdfsdk/javascript/cjs_eventhandler.cpp2
-rw-r--r--fpdfsdk/javascript/cjs_printparamsobj.cpp34
-rw-r--r--fpdfsdk/javascript/cjs_printparamsobj.h41
-rw-r--r--fpdfsdk/javascript/cjs_runtime.cpp3
9 files changed, 92 insertions, 91 deletions
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index a3bde1c0c3..c0c52aa76b 100644
--- a/fpdfsdk/javascript/Field.cpp
+++ b/fpdfsdk/javascript/Field.cpp
@@ -19,12 +19,12 @@
#include "fpdfsdk/cpdfsdk_interform.h"
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fpdfsdk/cpdfsdk_widget.h"
-#include "fpdfsdk/javascript/Document.h"
#include "fpdfsdk/javascript/Icon.h"
#include "fpdfsdk/javascript/JS_Define.h"
#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
#include "fpdfsdk/javascript/PublicMethods.h"
+#include "fpdfsdk/javascript/cjs_document.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
#include "fpdfsdk/javascript/cjs_eventhandler.h"
#include "fpdfsdk/javascript/cjs_runtime.h"
diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp
index fdc8b87725..b8582e9b10 100644
--- a/fpdfsdk/javascript/JS_Value.cpp
+++ b/fpdfsdk/javascript/JS_Value.cpp
@@ -13,9 +13,9 @@
#include <limits>
#include <vector>
-#include "fpdfsdk/javascript/Document.h"
#include "fpdfsdk/javascript/JS_Define.h"
#include "fpdfsdk/javascript/JS_Object.h"
+#include "fpdfsdk/javascript/cjs_document.h"
namespace {
diff --git a/fpdfsdk/javascript/app.cpp b/fpdfsdk/javascript/app.cpp
index 148b71f6dc..93af088b5c 100644
--- a/fpdfsdk/javascript/app.cpp
+++ b/fpdfsdk/javascript/app.cpp
@@ -12,10 +12,10 @@
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_interform.h"
-#include "fpdfsdk/javascript/Document.h"
#include "fpdfsdk/javascript/JS_Define.h"
#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
+#include "fpdfsdk/javascript/cjs_document.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
#include "fpdfsdk/javascript/cjs_eventhandler.h"
#include "fpdfsdk/javascript/cjs_runtime.h"
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/cjs_document.cpp
index d556872477..5726d2461d 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/cjs_document.cpp
@@ -1,72 +1,29 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
+// Copyright 2017 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
-#include "fpdfsdk/javascript/Document.h"
+#include "fpdfsdk/javascript/cjs_document.h"
-#include <algorithm>
-#include <sstream>
#include <utility>
-#include <vector>
#include "core/fpdfapi/font/cpdf_font.h"
-#include "core/fpdfapi/page/cpdf_page.h"
+#include "core/fpdfapi/page/cpdf_pageobject.h"
+#include "core/fpdfapi/page/cpdf_textobject.h"
#include "core/fpdfapi/parser/cpdf_array.h"
-#include "core/fpdfapi/parser/cpdf_document.h"
+#include "core/fpdfapi/parser/cpdf_name.h"
#include "core/fpdfapi/parser/cpdf_string.h"
-#include "core/fpdfapi/parser/fpdf_parser_decode.h"
#include "core/fpdfdoc/cpdf_interform.h"
#include "core/fpdfdoc/cpdf_nametree.h"
#include "fpdfsdk/cpdfsdk_annotiteration.h"
-#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_interform.h"
#include "fpdfsdk/cpdfsdk_pageview.h"
-#include "fpdfsdk/cpdfsdk_widget.h"
#include "fpdfsdk/javascript/Field.h"
#include "fpdfsdk/javascript/Icon.h"
-#include "fpdfsdk/javascript/JS_Define.h"
-#include "fpdfsdk/javascript/JS_Object.h"
-#include "fpdfsdk/javascript/JS_Value.h"
#include "fpdfsdk/javascript/app.h"
#include "fpdfsdk/javascript/cjs_annot.h"
-#include "fpdfsdk/javascript/cjs_event_context.h"
-#include "fpdfsdk/javascript/cjs_eventhandler.h"
-#include "fpdfsdk/javascript/cjs_runtime.h"
-#include "fpdfsdk/javascript/resource.h"
-#include "third_party/base/numerics/safe_math.h"
-#include "third_party/base/ptr_util.h"
-
-int CJS_PrintParamsObj::ObjDefnID = -1;
-
-// static
-int CJS_PrintParamsObj::GetObjDefnID() {
- return ObjDefnID;
-}
-
-// static
-void CJS_PrintParamsObj::DefineJSObjects(CFXJS_Engine* pEngine) {
- ObjDefnID =
- pEngine->DefineObj("PrintParamsObj", FXJSOBJTYPE_DYNAMIC,
- JSConstructor<CJS_PrintParamsObj, PrintParamsObj>,
- JSDestructor<CJS_PrintParamsObj>);
-}
-
-PrintParamsObj::PrintParamsObj(CJS_Object* pJSObject)
- : CJS_EmbedObj(pJSObject) {
- bUI = true;
- nStart = 0;
- nEnd = 0;
- bSilent = false;
- bShrinkToFit = false;
- bPrintAsImage = false;
- bReverse = false;
- bAnnotations = true;
-}
-
-#define MINWIDTH 5.0f
-#define MINHEIGHT 5.0f
+#include "fpdfsdk/javascript/cjs_printparamsobj.h"
const JSPropertySpec CJS_Document::PropertySpecs[] = {
{"ADBE", get_ADBE_static, set_ADBE_static},
diff --git a/fpdfsdk/javascript/Document.h b/fpdfsdk/javascript/cjs_document.h
index 043e6bee62..e6aab6b2c0 100644
--- a/fpdfsdk/javascript/Document.h
+++ b/fpdfsdk/javascript/cjs_document.h
@@ -1,52 +1,20 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
+// Copyright 2017 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 FPDFSDK_JAVASCRIPT_DOCUMENT_H_
-#define FPDFSDK_JAVASCRIPT_DOCUMENT_H_
+#ifndef FPDFSDK_JAVASCRIPT_CJS_DOCUMENT_H_
+#define FPDFSDK_JAVASCRIPT_CJS_DOCUMENT_H_
#include <list>
#include <memory>
#include <vector>
-#include "core/fpdfapi/page/cpdf_pageobject.h"
-#include "core/fpdfapi/page/cpdf_textobject.h"
-#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/javascript/JS_Define.h"
-class PrintParamsObj : public CJS_EmbedObj {
- public:
- explicit PrintParamsObj(CJS_Object* pJSObject);
- ~PrintParamsObj() override {}
-
- public:
- bool bUI;
- int nStart;
- int nEnd;
- bool bSilent;
- bool bShrinkToFit;
- bool bPrintAsImage;
- bool bReverse;
- bool bAnnotations;
-};
-
-class CJS_PrintParamsObj : public CJS_Object {
- public:
- static int GetObjDefnID();
- static void DefineJSObjects(CFXJS_Engine* pEngine);
-
- explicit CJS_PrintParamsObj(v8::Local<v8::Object> pObject)
- : CJS_Object(pObject) {}
- ~CJS_PrintParamsObj() override {}
-
- private:
- static int ObjDefnID;
-};
+class CPDF_TextObject;
-struct CJS_AnnotObj;
-struct CJS_DelayAnnot;
struct CJS_DelayData;
class Document : public CJS_EmbedObj {
@@ -358,4 +326,4 @@ class CJS_Document : public CJS_Object {
static const JSMethodSpec MethodSpecs[];
};
-#endif // FPDFSDK_JAVASCRIPT_DOCUMENT_H_
+#endif // FPDFSDK_JAVASCRIPT_CJS_DOCUMENT_H_
diff --git a/fpdfsdk/javascript/cjs_eventhandler.cpp b/fpdfsdk/javascript/cjs_eventhandler.cpp
index f1d37e2091..ada365a268 100644
--- a/fpdfsdk/javascript/cjs_eventhandler.cpp
+++ b/fpdfsdk/javascript/cjs_eventhandler.cpp
@@ -6,11 +6,11 @@
#include "fpdfsdk/javascript/cjs_eventhandler.h"
-#include "fpdfsdk/javascript/Document.h"
#include "fpdfsdk/javascript/Field.h"
#include "fpdfsdk/javascript/JS_Define.h"
#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
+#include "fpdfsdk/javascript/cjs_document.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
#include "fpdfsdk/javascript/cjs_runtime.h"
diff --git a/fpdfsdk/javascript/cjs_printparamsobj.cpp b/fpdfsdk/javascript/cjs_printparamsobj.cpp
new file mode 100644
index 0000000000..266298abdd
--- /dev/null
+++ b/fpdfsdk/javascript/cjs_printparamsobj.cpp
@@ -0,0 +1,34 @@
+// Copyright 2017 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
+
+#include "fpdfsdk/javascript/cjs_printparamsobj.h"
+
+int CJS_PrintParamsObj::ObjDefnID = -1;
+
+// static
+int CJS_PrintParamsObj::GetObjDefnID() {
+ return ObjDefnID;
+}
+
+// static
+void CJS_PrintParamsObj::DefineJSObjects(CFXJS_Engine* pEngine) {
+ ObjDefnID =
+ pEngine->DefineObj("PrintParamsObj", FXJSOBJTYPE_DYNAMIC,
+ JSConstructor<CJS_PrintParamsObj, PrintParamsObj>,
+ JSDestructor<CJS_PrintParamsObj>);
+}
+
+PrintParamsObj::PrintParamsObj(CJS_Object* pJSObject)
+ : CJS_EmbedObj(pJSObject) {
+ bUI = true;
+ nStart = 0;
+ nEnd = 0;
+ bSilent = false;
+ bShrinkToFit = false;
+ bPrintAsImage = false;
+ bReverse = false;
+ bAnnotations = true;
+}
diff --git a/fpdfsdk/javascript/cjs_printparamsobj.h b/fpdfsdk/javascript/cjs_printparamsobj.h
new file mode 100644
index 0000000000..8029b82330
--- /dev/null
+++ b/fpdfsdk/javascript/cjs_printparamsobj.h
@@ -0,0 +1,41 @@
+// Copyright 2017 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 FPDFSDK_JAVASCRIPT_CJS_PRINTPARAMSOBJ_H_
+#define FPDFSDK_JAVASCRIPT_CJS_PRINTPARAMSOBJ_H_
+
+#include "fpdfsdk/javascript/JS_Define.h"
+
+class PrintParamsObj : public CJS_EmbedObj {
+ public:
+ explicit PrintParamsObj(CJS_Object* pJSObject);
+ ~PrintParamsObj() override {}
+
+ public:
+ bool bUI;
+ int nStart;
+ int nEnd;
+ bool bSilent;
+ bool bShrinkToFit;
+ bool bPrintAsImage;
+ bool bReverse;
+ bool bAnnotations;
+};
+
+class CJS_PrintParamsObj : public CJS_Object {
+ public:
+ static int GetObjDefnID();
+ static void DefineJSObjects(CFXJS_Engine* pEngine);
+
+ explicit CJS_PrintParamsObj(v8::Local<v8::Object> pObject)
+ : CJS_Object(pObject) {}
+ ~CJS_PrintParamsObj() override {}
+
+ private:
+ static int ObjDefnID;
+};
+
+#endif // FPDFSDK_JAVASCRIPT_CJS_PRINTPARAMSOBJ_H_
diff --git a/fpdfsdk/javascript/cjs_runtime.cpp b/fpdfsdk/javascript/cjs_runtime.cpp
index 57dfffe716..7419ab1cc2 100644
--- a/fpdfsdk/javascript/cjs_runtime.cpp
+++ b/fpdfsdk/javascript/cjs_runtime.cpp
@@ -9,7 +9,6 @@
#include <algorithm>
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
-#include "fpdfsdk/javascript/Document.h"
#include "fpdfsdk/javascript/Field.h"
#include "fpdfsdk/javascript/Icon.h"
#include "fpdfsdk/javascript/JS_Define.h"
@@ -21,6 +20,7 @@
#include "fpdfsdk/javascript/cjs_annot.h"
#include "fpdfsdk/javascript/cjs_border.h"
#include "fpdfsdk/javascript/cjs_display.h"
+#include "fpdfsdk/javascript/cjs_document.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
#include "fpdfsdk/javascript/cjs_eventhandler.h"
#include "fpdfsdk/javascript/cjs_font.h"
@@ -29,6 +29,7 @@
#include "fpdfsdk/javascript/cjs_globalconsts.h"
#include "fpdfsdk/javascript/cjs_highlight.h"
#include "fpdfsdk/javascript/cjs_position.h"
+#include "fpdfsdk/javascript/cjs_printparamsobj.h"
#include "fpdfsdk/javascript/cjs_scalehow.h"
#include "fpdfsdk/javascript/cjs_scalewhen.h"
#include "fpdfsdk/javascript/cjs_style.h"