summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-30 15:35:42 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-10-30 15:35:42 +0000
commit451e4c80dae398ef2349afa51c242e313f5e6c63 (patch)
treed569a8870961ecbc1791c30ae805c97670324f37
parent1fc3c3b309d96b4e4f4c6d8b270a4e72710ca4a1 (diff)
downloadpdfium-451e4c80dae398ef2349afa51c242e313f5e6c63.tar.xz
Rename Document to match class
This CL renames fpdfsdk/javascript/Document.{cpp|h} to fpdfsdk/javascript/cjs_document.{cpp|h}. The CJS_PrintParamsObj is split out into cjs_printparamsobj.{cpp|h}. Change-Id: I29377e7e60b576790fab01e4293c0c1f86339a56 Reviewed-on: https://pdfium-review.googlesource.com/17032 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r--BUILD.gn6
-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
10 files changed, 96 insertions, 93 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 9c6811f26b..b7f4bbb10d 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1188,8 +1188,6 @@ static_library("javascript") {
if (pdf_enable_v8) {
sources += [
- "fpdfsdk/javascript/Document.cpp",
- "fpdfsdk/javascript/Document.h",
"fpdfsdk/javascript/Field.cpp",
"fpdfsdk/javascript/Field.h",
"fpdfsdk/javascript/Icon.cpp",
@@ -1213,6 +1211,8 @@ static_library("javascript") {
"fpdfsdk/javascript/cjs_border.h",
"fpdfsdk/javascript/cjs_display.cpp",
"fpdfsdk/javascript/cjs_display.h",
+ "fpdfsdk/javascript/cjs_document.cpp",
+ "fpdfsdk/javascript/cjs_document.h",
"fpdfsdk/javascript/cjs_event_context.cpp",
"fpdfsdk/javascript/cjs_event_context.h",
"fpdfsdk/javascript/cjs_eventhandler.cpp",
@@ -1229,6 +1229,8 @@ static_library("javascript") {
"fpdfsdk/javascript/cjs_highlight.h",
"fpdfsdk/javascript/cjs_position.cpp",
"fpdfsdk/javascript/cjs_position.h",
+ "fpdfsdk/javascript/cjs_printparamsobj.cpp",
+ "fpdfsdk/javascript/cjs_printparamsobj.h",
"fpdfsdk/javascript/cjs_runtime.cpp",
"fpdfsdk/javascript/cjs_runtime.h",
"fpdfsdk/javascript/cjs_scalehow.cpp",
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"