From 8a752ab21daa2dcd0314ab5e3908f8d6e7bba2b7 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 29 Sep 2016 11:59:54 -0700 Subject: Move core/fpdfapi/fpdf_page/include to core/fpdfapi/fpdf_page BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2379033002 --- BUILD.gn | 32 +++--- .../fpdf_edit/cpdf_pagecontentgenerator.cpp | 8 +- core/fpdfapi/fpdf_font/cpdf_type3char.cpp | 8 +- core/fpdfapi/fpdf_font/cpdf_type3font.cpp | 2 +- core/fpdfapi/fpdf_font/fpdf_font.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_clippath.cpp | 6 +- core/fpdfapi/fpdf_page/cpdf_clippath.h | 63 +++++++++++ core/fpdfapi/fpdf_page/cpdf_color.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_color.h | 41 +++++++ core/fpdfapi/fpdf_page/cpdf_colorspace.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_colorspace.h | 121 +++++++++++++++++++++ core/fpdfapi/fpdf_page/cpdf_colorstate.h | 2 +- core/fpdfapi/fpdf_page/cpdf_countedobject.h | 2 +- core/fpdfapi/fpdf_page/cpdf_form.cpp | 6 +- core/fpdfapi/fpdf_page/cpdf_form.h | 41 +++++++ core/fpdfapi/fpdf_page/cpdf_formobject.cpp | 4 +- core/fpdfapi/fpdf_page/cpdf_formobject.h | 37 +++++++ core/fpdfapi/fpdf_page/cpdf_generalstate.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_generalstate.h | 109 +++++++++++++++++++ core/fpdfapi/fpdf_page/cpdf_graphicstates.h | 6 +- core/fpdfapi/fpdf_page/cpdf_image.cpp | 4 +- core/fpdfapi/fpdf_page/cpdf_image.h | 90 +++++++++++++++ core/fpdfapi/fpdf_page/cpdf_imageobject.cpp | 4 +- core/fpdfapi/fpdf_page/cpdf_imageobject.h | 44 ++++++++ core/fpdfapi/fpdf_page/cpdf_meshstream.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_page.cpp | 4 +- core/fpdfapi/fpdf_page/cpdf_page.h | 69 ++++++++++++ core/fpdfapi/fpdf_page/cpdf_pagemodule.h | 2 +- core/fpdfapi/fpdf_page/cpdf_pageobject.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_pageobject.h | 71 ++++++++++++ core/fpdfapi/fpdf_page/cpdf_pageobjectholder.cpp | 4 +- core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h | 68 ++++++++++++ core/fpdfapi/fpdf_page/cpdf_path.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_path.h | 50 +++++++++ core/fpdfapi/fpdf_page/cpdf_pathobject.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_pathobject.h | 36 ++++++ core/fpdfapi/fpdf_page/cpdf_shadingobject.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_shadingobject.h | 34 ++++++ core/fpdfapi/fpdf_page/cpdf_textobject.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_textobject.h | 69 ++++++++++++ core/fpdfapi/fpdf_page/cpdf_textstate.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_textstate.h | 91 ++++++++++++++++ core/fpdfapi/fpdf_page/cpdf_tilingpattern.cpp | 2 +- core/fpdfapi/fpdf_page/fpdf_page_doc.cpp | 2 +- core/fpdfapi/fpdf_page/fpdf_page_parser.cpp | 16 +-- core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp | 8 +- core/fpdfapi/fpdf_page/include/cpdf_clippath.h | 63 ----------- core/fpdfapi/fpdf_page/include/cpdf_color.h | 41 ------- core/fpdfapi/fpdf_page/include/cpdf_colorspace.h | 121 --------------------- core/fpdfapi/fpdf_page/include/cpdf_form.h | 41 ------- core/fpdfapi/fpdf_page/include/cpdf_formobject.h | 37 ------- core/fpdfapi/fpdf_page/include/cpdf_generalstate.h | 109 ------------------- core/fpdfapi/fpdf_page/include/cpdf_image.h | 90 --------------- core/fpdfapi/fpdf_page/include/cpdf_imageobject.h | 44 -------- core/fpdfapi/fpdf_page/include/cpdf_page.h | 69 ------------ core/fpdfapi/fpdf_page/include/cpdf_pageobject.h | 71 ------------ .../fpdf_page/include/cpdf_pageobjectholder.h | 68 ------------ core/fpdfapi/fpdf_page/include/cpdf_path.h | 50 --------- core/fpdfapi/fpdf_page/include/cpdf_pathobject.h | 36 ------ .../fpdfapi/fpdf_page/include/cpdf_shadingobject.h | 34 ------ core/fpdfapi/fpdf_page/include/cpdf_textobject.h | 69 ------------ core/fpdfapi/fpdf_page/include/cpdf_textstate.h | 91 ---------------- core/fpdfapi/fpdf_page/pageint.h | 2 +- core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp | 2 +- core/fpdfapi/fpdf_render/fpdf_render.cpp | 16 +-- core/fpdfapi/fpdf_render/fpdf_render_cache.cpp | 2 +- core/fpdfapi/fpdf_render/fpdf_render_image.cpp | 8 +- core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 4 +- core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp | 8 +- core/fpdfapi/fpdf_render/fpdf_render_text.cpp | 10 +- core/fpdfapi/fpdf_render/render_int.h | 2 +- core/fpdfdoc/cpdf_annot.cpp | 4 +- core/fpdfdoc/cpdf_annotlist.cpp | 2 +- core/fpdfdoc/cpdf_formcontrol.cpp | 2 +- core/fpdfdoc/cpdf_interform.cpp | 2 +- core/fpdfdoc/cpdf_linklist.cpp | 2 +- core/fpdfdoc/cpdf_occontext.cpp | 2 +- core/fpdftext/cpdf_textpage.cpp | 10 +- core/fxcodec/codec/fx_codec_jpx_opj.cpp | 2 +- fpdfsdk/DEPS | 2 +- fpdfsdk/cba_annotiterator.cpp | 2 +- fpdfsdk/cpdfsdk_baannothandler.cpp | 2 +- fpdfsdk/cpdfsdk_interform.cpp | 2 +- fpdfsdk/cpdfsdk_widgethandler.cpp | 2 +- fpdfsdk/formfiller/cba_fontmap.cpp | 2 +- fpdfsdk/formfiller/cffl_formfiller.cpp | 2 +- fpdfsdk/formfiller/cffl_interactiveformfiller.cpp | 2 +- fpdfsdk/fpdf_flatten.cpp | 4 +- fpdfsdk/fpdf_progressive.cpp | 2 +- fpdfsdk/fpdf_transformpage.cpp | 8 +- fpdfsdk/fpdfdoc.cpp | 2 +- fpdfsdk/fpdfeditimg.cpp | 6 +- fpdfsdk/fpdfeditpage.cpp | 14 +-- fpdfsdk/fpdfformfill.cpp | 2 +- fpdfsdk/fpdftext.cpp | 2 +- fpdfsdk/fpdfview.cpp | 2 +- fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 2 +- fpdfsdk/fpdfxfa/fpdfxfa_page.cpp | 2 +- fpdfsdk/fxedit/fxet_edit.cpp | 8 +- fpdfsdk/include/cpdfsdk_environment.h | 2 +- fpdfsdk/include/cpdfsdk_pageview.h | 2 +- fpdfsdk/javascript/Document.cpp | 2 +- fpdfsdk/javascript/Document.h | 4 +- fpdfsdk/javascript/Field.cpp | 2 +- xfa/fxfa/app/DEPS | 2 +- xfa/fxfa/app/xfa_ffwidget.cpp | 2 +- 106 files changed, 1189 insertions(+), 1189 deletions(-) create mode 100644 core/fpdfapi/fpdf_page/cpdf_clippath.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_color.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_colorspace.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_form.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_formobject.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_generalstate.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_image.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_imageobject.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_page.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_pageobject.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_path.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_pathobject.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_shadingobject.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_textobject.h create mode 100644 core/fpdfapi/fpdf_page/cpdf_textstate.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_clippath.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_color.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_colorspace.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_form.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_formobject.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_generalstate.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_image.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_imageobject.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_page.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_pageobject.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_path.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_pathobject.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_shadingobject.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_textobject.h delete mode 100644 core/fpdfapi/fpdf_page/include/cpdf_textstate.h diff --git a/BUILD.gn b/BUILD.gn index bd36891a38..906a4faded 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -421,8 +421,11 @@ static_library("fpdfapi") { "core/fpdfapi/fpdf_page/cpdf_allstates.cpp", "core/fpdfapi/fpdf_page/cpdf_allstates.h", "core/fpdfapi/fpdf_page/cpdf_clippath.cpp", + "core/fpdfapi/fpdf_page/cpdf_clippath.h", "core/fpdfapi/fpdf_page/cpdf_color.cpp", + "core/fpdfapi/fpdf_page/cpdf_color.h", "core/fpdfapi/fpdf_page/cpdf_colorspace.cpp", + "core/fpdfapi/fpdf_page/cpdf_colorspace.h", "core/fpdfapi/fpdf_page/cpdf_colorstate.cpp", "core/fpdfapi/fpdf_page/cpdf_colorstate.h", "core/fpdfapi/fpdf_page/cpdf_contentmark.cpp", @@ -431,30 +434,43 @@ static_library("fpdfapi") { "core/fpdfapi/fpdf_page/cpdf_contentmarkitem.h", "core/fpdfapi/fpdf_page/cpdf_countedobject.h", "core/fpdfapi/fpdf_page/cpdf_form.cpp", + "core/fpdfapi/fpdf_page/cpdf_form.h", "core/fpdfapi/fpdf_page/cpdf_formobject.cpp", + "core/fpdfapi/fpdf_page/cpdf_formobject.h", "core/fpdfapi/fpdf_page/cpdf_generalstate.cpp", + "core/fpdfapi/fpdf_page/cpdf_generalstate.h", "core/fpdfapi/fpdf_page/cpdf_graphicstates.cpp", "core/fpdfapi/fpdf_page/cpdf_graphicstates.h", "core/fpdfapi/fpdf_page/cpdf_image.cpp", + "core/fpdfapi/fpdf_page/cpdf_image.h", "core/fpdfapi/fpdf_page/cpdf_imageobject.cpp", + "core/fpdfapi/fpdf_page/cpdf_imageobject.h", "core/fpdfapi/fpdf_page/cpdf_meshstream.cpp", "core/fpdfapi/fpdf_page/cpdf_meshstream.h", "core/fpdfapi/fpdf_page/cpdf_page.cpp", + "core/fpdfapi/fpdf_page/cpdf_page.h", "core/fpdfapi/fpdf_page/cpdf_pagemodule.cpp", "core/fpdfapi/fpdf_page/cpdf_pagemodule.h", "core/fpdfapi/fpdf_page/cpdf_pageobject.cpp", + "core/fpdfapi/fpdf_page/cpdf_pageobject.h", "core/fpdfapi/fpdf_page/cpdf_pageobjectholder.cpp", + "core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h", "core/fpdfapi/fpdf_page/cpdf_pageobjectlist.cpp", "core/fpdfapi/fpdf_page/cpdf_pageobjectlist.h", "core/fpdfapi/fpdf_page/cpdf_path.cpp", + "core/fpdfapi/fpdf_page/cpdf_path.h", "core/fpdfapi/fpdf_page/cpdf_pathobject.cpp", + "core/fpdfapi/fpdf_page/cpdf_pathobject.h", "core/fpdfapi/fpdf_page/cpdf_pattern.cpp", "core/fpdfapi/fpdf_page/cpdf_pattern.h", "core/fpdfapi/fpdf_page/cpdf_shadingobject.cpp", + "core/fpdfapi/fpdf_page/cpdf_shadingobject.h", "core/fpdfapi/fpdf_page/cpdf_shadingpattern.cpp", "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h", "core/fpdfapi/fpdf_page/cpdf_textobject.cpp", + "core/fpdfapi/fpdf_page/cpdf_textobject.h", "core/fpdfapi/fpdf_page/cpdf_textstate.cpp", + "core/fpdfapi/fpdf_page/cpdf_textstate.h", "core/fpdfapi/fpdf_page/cpdf_tilingpattern.cpp", "core/fpdfapi/fpdf_page/cpdf_tilingpattern.h", "core/fpdfapi/fpdf_page/fpdf_page_colors.cpp", @@ -462,22 +478,6 @@ static_library("fpdfapi") { "core/fpdfapi/fpdf_page/fpdf_page_func.cpp", "core/fpdfapi/fpdf_page/fpdf_page_parser.cpp", "core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp", - "core/fpdfapi/fpdf_page/include/cpdf_clippath.h", - "core/fpdfapi/fpdf_page/include/cpdf_color.h", - "core/fpdfapi/fpdf_page/include/cpdf_colorspace.h", - "core/fpdfapi/fpdf_page/include/cpdf_form.h", - "core/fpdfapi/fpdf_page/include/cpdf_formobject.h", - "core/fpdfapi/fpdf_page/include/cpdf_generalstate.h", - "core/fpdfapi/fpdf_page/include/cpdf_image.h", - "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h", - "core/fpdfapi/fpdf_page/include/cpdf_page.h", - "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h", - "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h", - "core/fpdfapi/fpdf_page/include/cpdf_path.h", - "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h", - "core/fpdfapi/fpdf_page/include/cpdf_shadingobject.h", - "core/fpdfapi/fpdf_page/include/cpdf_textobject.h", - "core/fpdfapi/fpdf_page/include/cpdf_textstate.h", "core/fpdfapi/fpdf_page/pageint.h", "core/fpdfapi/fpdf_parser/cfdf_document.cpp", "core/fpdfapi/fpdf_parser/cpdf_array.cpp", diff --git a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp index 7cf7b69ff2..e0099dd60b 100644 --- a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp +++ b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp @@ -7,10 +7,10 @@ #include "core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.h" #include "core/fpdfapi/fpdf_edit/cpdf_creator.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_image.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_image.h" +#include "core/fpdfapi/fpdf_page/cpdf_imageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" diff --git a/core/fpdfapi/fpdf_font/cpdf_type3char.cpp b/core/fpdfapi/fpdf_font/cpdf_type3char.cpp index b80a4ccdd0..c97e26d76b 100644 --- a/core/fpdfapi/fpdf_font/cpdf_type3char.cpp +++ b/core/fpdfapi/fpdf_font/cpdf_type3char.cpp @@ -6,10 +6,10 @@ #include "core/fpdfapi/fpdf_font/cpdf_type3char.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_image.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_image.h" +#include "core/fpdfapi/fpdf_page/cpdf_imageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" #include "core/fxge/include/fx_dib.h" CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm) diff --git a/core/fpdfapi/fpdf_font/cpdf_type3font.cpp b/core/fpdfapi/fpdf_font/cpdf_type3font.cpp index 520ffa64d9..4b4d1439d9 100644 --- a/core/fpdfapi/fpdf_font/cpdf_type3font.cpp +++ b/core/fpdfapi/fpdf_font/cpdf_type3font.cpp @@ -9,7 +9,7 @@ #include #include "core/fpdfapi/fpdf_font/cpdf_type3char.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" diff --git a/core/fpdfapi/fpdf_font/fpdf_font.cpp b/core/fpdfapi/fpdf_font/fpdf_font.cpp index a463c15da5..50eaed1e7d 100644 --- a/core/fpdfapi/fpdf_font/fpdf_font.cpp +++ b/core/fpdfapi/fpdf_font/fpdf_font.cpp @@ -6,8 +6,8 @@ #include "core/fpdfapi/fpdf_font/font_int.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" #include "core/fpdfapi/fpdf_page/cpdf_pagemodule.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_clippath.cpp b/core/fpdfapi/fpdf_page/cpdf_clippath.cpp index 51ff593a5a..62f5a37653 100644 --- a/core/fpdfapi/fpdf_page/cpdf_clippath.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_clippath.cpp @@ -4,12 +4,12 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_clippath.h" +#include "core/fpdfapi/fpdf_page/cpdf_clippath.h" #include -#include "core/fpdfapi/fpdf_page/include/cpdf_path.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_path.h" +#include "core/fpdfapi/fpdf_page/cpdf_textobject.h" #include "third_party/base/stl_util.h" #define FPDF_CLIPPATH_MAX_TEXTS 1024 diff --git a/core/fpdfapi/fpdf_page/cpdf_clippath.h b/core/fpdfapi/fpdf_page/cpdf_clippath.h new file mode 100644 index 0000000000..bff9794085 --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_clippath.h @@ -0,0 +1,63 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_CLIPPATH_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_CLIPPATH_H_ + +#include +#include +#include + +#include "core/fpdfapi/fpdf_page/cpdf_path.h" +#include "core/fxcrt/include/cfx_count_ref.h" +#include "core/fxcrt/include/fx_basic.h" +#include "core/fxcrt/include/fx_coordinates.h" + +class CPDF_Path; +class CPDF_TextObject; + +class CPDF_ClipPath { + public: + CPDF_ClipPath(); + CPDF_ClipPath(const CPDF_ClipPath& that); + ~CPDF_ClipPath(); + + void Emplace() { m_Ref.Emplace(); } + void SetNull() { m_Ref.SetNull(); } + + explicit operator bool() const { return !!m_Ref; } + bool operator==(const CPDF_ClipPath& that) const { + return m_Ref == that.m_Ref; + } + bool operator!=(const CPDF_ClipPath& that) const { return !(*this == that); } + + uint32_t GetPathCount() const; + CPDF_Path GetPath(size_t i) const; + uint8_t GetClipType(size_t i) const; + uint32_t GetTextCount() const; + CPDF_TextObject* GetText(size_t i) const; + CFX_FloatRect GetClipBox() const; + void AppendPath(CPDF_Path path, uint8_t type, bool bAutoMerge); + void AppendTexts(std::vector>* pTexts); + void Transform(const CFX_Matrix& matrix); + + private: + class PathData { + public: + using PathAndTypeData = std::pair; + + PathData(); + PathData(const PathData& that); + ~PathData(); + + std::vector m_PathAndTypeList; + std::vector> m_TextList; + }; + + CFX_CountRef m_Ref; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_CLIPPATH_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_color.cpp b/core/fpdfapi/fpdf_page/cpdf_color.cpp index 054b1ecf40..425fc0ca4b 100644 --- a/core/fpdfapi/fpdf_page/cpdf_color.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_color.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_color.h" +#include "core/fpdfapi/fpdf_page/cpdf_color.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_color.h b/core/fpdfapi/fpdf_page/cpdf_color.h new file mode 100644 index 0000000000..f74b5f45d2 --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_color.h @@ -0,0 +1,41 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_COLOR_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_COLOR_H_ + +#include "core/fpdfapi/fpdf_page/cpdf_colorspace.h" +#include "core/fxcrt/include/fx_system.h" + +class CPDF_Pattern; + +class CPDF_Color { + public: + CPDF_Color(); + ~CPDF_Color(); + + bool IsNull() const { return !m_pBuffer; } + bool IsPattern() const; + + void Copy(const CPDF_Color* pSrc); + + void SetColorSpace(CPDF_ColorSpace* pCS); + void SetValue(FX_FLOAT* comp); + void SetValue(CPDF_Pattern* pPattern, FX_FLOAT* comp, int ncomps); + + FX_BOOL GetRGB(int& R, int& G, int& B) const; + CPDF_Pattern* GetPattern() const; + const CPDF_ColorSpace* GetColorSpace() const { return m_pCS; } + + protected: + void ReleaseBuffer(); + void ReleaseColorSpace(); + + CPDF_ColorSpace* m_pCS; + FX_FLOAT* m_pBuffer; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLOR_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp b/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp index 87607648b6..0dc2091e74 100644 --- a/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_colorspace.h" +#include "core/fpdfapi/fpdf_page/cpdf_colorspace.h" #include diff --git a/core/fpdfapi/fpdf_page/cpdf_colorspace.h b/core/fpdfapi/fpdf_page/cpdf_colorspace.h new file mode 100644 index 0000000000..951de3ee12 --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_colorspace.h @@ -0,0 +1,121 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSPACE_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSPACE_H_ + +#include + +#include "core/fxcrt/include/fx_string.h" +#include "core/fxcrt/include/fx_system.h" + +#define PDFCS_DEVICEGRAY 1 +#define PDFCS_DEVICERGB 2 +#define PDFCS_DEVICECMYK 3 +#define PDFCS_CALGRAY 4 +#define PDFCS_CALRGB 5 +#define PDFCS_LAB 6 +#define PDFCS_ICCBASED 7 +#define PDFCS_SEPARATION 8 +#define PDFCS_DEVICEN 9 +#define PDFCS_INDEXED 10 +#define PDFCS_PATTERN 11 + +class CPDF_Array; +class CPDF_Document; +class CPDF_Object; + +class CPDF_ColorSpace { + public: + static CPDF_ColorSpace* GetStockCS(int Family); + static CPDF_ColorSpace* ColorspaceFromName(const CFX_ByteString& name); + static std::unique_ptr Load(CPDF_Document* pDoc, + CPDF_Object* pCSObj); + + void Release(); + + int GetBufSize() const; + FX_FLOAT* CreateBuf(); + void GetDefaultColor(FX_FLOAT* buf) const; + uint32_t CountComponents() const; + int GetFamily() const { return m_Family; } + virtual void GetDefaultValue(int iComponent, + FX_FLOAT& value, + FX_FLOAT& min, + FX_FLOAT& max) const; + + FX_BOOL sRGB() const; + virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, + FX_FLOAT& R, + FX_FLOAT& G, + FX_FLOAT& B) const = 0; + virtual FX_BOOL SetRGB(FX_FLOAT* pBuf, + FX_FLOAT R, + FX_FLOAT G, + FX_FLOAT B) const; + + FX_BOOL GetCMYK(FX_FLOAT* pBuf, + FX_FLOAT& c, + FX_FLOAT& m, + FX_FLOAT& y, + FX_FLOAT& k) const; + FX_BOOL SetCMYK(FX_FLOAT* pBuf, + FX_FLOAT c, + FX_FLOAT m, + FX_FLOAT y, + FX_FLOAT k) const; + + virtual void TranslateImageLine(uint8_t* dest_buf, + const uint8_t* src_buf, + int pixels, + int image_width, + int image_height, + FX_BOOL bTransMask = FALSE) const; + + CPDF_Array*& GetArray() { return m_pArray; } + virtual CPDF_ColorSpace* GetBaseCS() const; + + virtual void EnableStdConversion(FX_BOOL bEnabled); + + CPDF_Document* const m_pDocument; + + protected: + CPDF_ColorSpace(CPDF_Document* pDoc, int family, uint32_t nComponents); + virtual ~CPDF_ColorSpace(); + + virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray); + virtual FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, + FX_FLOAT& c, + FX_FLOAT& m, + FX_FLOAT& y, + FX_FLOAT& k) const; + virtual FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, + FX_FLOAT c, + FX_FLOAT m, + FX_FLOAT y, + FX_FLOAT k) const; + + int m_Family; + uint32_t m_nComponents; + CPDF_Array* m_pArray; + uint32_t m_dwStdConversion; +}; + +namespace std { + +// Make std::unique_ptr call Release() rather than +// simply deleting the object. +template <> +struct default_delete { + void operator()(CPDF_ColorSpace* pColorSpace) const { + if (pColorSpace) + pColorSpace->Release(); + } +}; + +} // namespace std + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSPACE_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstate.h b/core/fpdfapi/fpdf_page/cpdf_colorstate.h index f6f72a2b46..3f2d5632e7 100644 --- a/core/fpdfapi/fpdf_page/cpdf_colorstate.h +++ b/core/fpdfapi/fpdf_page/cpdf_colorstate.h @@ -7,7 +7,7 @@ #ifndef CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ #define CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ -#include "core/fpdfapi/fpdf_page/include/cpdf_color.h" +#include "core/fpdfapi/fpdf_page/cpdf_color.h" #include "core/fxcrt/include/cfx_count_ref.h" #include "core/fxcrt/include/fx_basic.h" #include "core/fxcrt/include/fx_system.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_countedobject.h b/core/fpdfapi/fpdf_page/cpdf_countedobject.h index c61e024589..aff83e1ed4 100644 --- a/core/fpdfapi/fpdf_page/cpdf_countedobject.h +++ b/core/fpdfapi/fpdf_page/cpdf_countedobject.h @@ -7,8 +7,8 @@ #ifndef CORE_FPDFAPI_FPDF_PAGE_CPDF_COUNTEDOBJECT_H_ #define CORE_FPDFAPI_FPDF_PAGE_CPDF_COUNTEDOBJECT_H_ +#include "core/fpdfapi/fpdf_page/cpdf_colorspace.h" #include "core/fpdfapi/fpdf_page/cpdf_pattern.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_colorspace.h" #include "core/fxcrt/include/fx_system.h" template diff --git a/core/fpdfapi/fpdf_page/cpdf_form.cpp b/core/fpdfapi/fpdf_page/cpdf_form.cpp index bf0dade4b1..c72690d200 100644 --- a/core/fpdfapi/fpdf_page/cpdf_form.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_form.cpp @@ -4,10 +4,10 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_form.h b/core/fpdfapi/fpdf_page/cpdf_form.h new file mode 100644 index 0000000000..1b88763d2c --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_form.h @@ -0,0 +1,41 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_FORM_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_FORM_H_ + +#include "core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h" + +class CPDF_Document; +class CPDF_Dictionary; +class CPDF_Stream; +class CPDF_AllStates; +class CFX_Matrix; +class CPDF_Type3Char; + +class CPDF_Form : public CPDF_PageObjectHolder { + public: + CPDF_Form(CPDF_Document* pDocument, + CPDF_Dictionary* pPageResources, + CPDF_Stream* pFormStream, + CPDF_Dictionary* pParentResources = nullptr); + ~CPDF_Form() override; + + void ParseContent(CPDF_AllStates* pGraphicStates, + const CFX_Matrix* pParentMatrix, + CPDF_Type3Char* pType3Char, + int level = 0); + + CPDF_Form* Clone() const; + + private: + void StartParse(CPDF_AllStates* pGraphicStates, + const CFX_Matrix* pParentMatrix, + CPDF_Type3Char* pType3Char, + int level = 0); +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_FORM_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_formobject.cpp b/core/fpdfapi/fpdf_page/cpdf_formobject.cpp index dc93ed3c54..d027d1dbf9 100644 --- a/core/fpdfapi/fpdf_page/cpdf_formobject.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_formobject.cpp @@ -4,9 +4,9 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_formobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_formobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" CPDF_FormObject::CPDF_FormObject() {} diff --git a/core/fpdfapi/fpdf_page/cpdf_formobject.h b/core/fpdfapi/fpdf_page/cpdf_formobject.h new file mode 100644 index 0000000000..f776c91562 --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_formobject.h @@ -0,0 +1,37 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_FORMOBJECT_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_FORMOBJECT_H_ + +#include + +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fxcrt/include/fx_coordinates.h" + +class CPDF_Form; + +class CPDF_FormObject : public CPDF_PageObject { + public: + CPDF_FormObject(); + ~CPDF_FormObject() override; + + // CPDF_PageObject: + CPDF_FormObject* Clone() const override; + Type GetType() const override; + void Transform(const CFX_Matrix& matrix) override; + bool IsForm() const override; + CPDF_FormObject* AsForm() override; + const CPDF_FormObject* AsForm() const override; + + void CalcBoundingBox(); + const CPDF_Form* form() const { return m_pForm.get(); } + + std::unique_ptr m_pForm; + CFX_Matrix m_FormMatrix; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_FORMOBJECT_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_generalstate.cpp b/core/fpdfapi/fpdf_page/cpdf_generalstate.cpp index 601cf0cebc..f37fa7233b 100644 --- a/core/fpdfapi/fpdf_page/cpdf_generalstate.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_generalstate.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_generalstate.h" +#include "core/fpdfapi/fpdf_page/cpdf_generalstate.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_render/render_int.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_generalstate.h b/core/fpdfapi/fpdf_page/cpdf_generalstate.h new file mode 100644 index 0000000000..e3b4d689ba --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_generalstate.h @@ -0,0 +1,109 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_GENERALSTATE_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_GENERALSTATE_H_ + +#include "core/fxcrt/include/fx_basic.h" +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxge/include/fx_dib.h" + +class CPDF_Object; +class CPDF_TransferFunc; + +class CPDF_GeneralState { + public: + CPDF_GeneralState(); + CPDF_GeneralState(const CPDF_GeneralState& that); + ~CPDF_GeneralState(); + + void Emplace() { m_Ref.Emplace(); } + explicit operator bool() const { return !!m_Ref; } + + void SetRenderIntent(const CFX_ByteString& ri); + + int GetBlendType() const; + void SetBlendType(int type); + + FX_FLOAT GetFillAlpha() const; + void SetFillAlpha(FX_FLOAT alpha); + + FX_FLOAT GetStrokeAlpha() const; + void SetStrokeAlpha(FX_FLOAT alpha); + + CPDF_Object* GetSoftMask() const; + void SetSoftMask(CPDF_Object* pObject); + + CPDF_Object* GetTR() const; + void SetTR(CPDF_Object* pObject); + + CPDF_TransferFunc* GetTransferFunc() const; + void SetTransferFunc(CPDF_TransferFunc* pFunc); + + void SetBlendMode(const CFX_ByteString& mode); + + const CFX_Matrix* GetSMaskMatrix() const; + void SetSMaskMatrix(const CFX_Matrix& matrix); + + bool GetFillOP() const; + void SetFillOP(bool op); + + bool GetStrokeOP() const; + void SetStrokeOP(bool op); + + int GetOPMode() const; + void SetOPMode(int mode); + + void SetBG(CPDF_Object* pObject); + void SetUCR(CPDF_Object* pObject); + void SetHT(CPDF_Object* pObject); + + void SetFlatness(FX_FLOAT flatness); + void SetSmoothness(FX_FLOAT smoothness); + + bool GetStrokeAdjust() const; + void SetStrokeAdjust(bool adjust); + + void SetAlphaSource(bool source); + void SetTextKnockout(bool knockout); + + void SetMatrix(const CFX_Matrix& matrix); + CFX_Matrix* GetMutableMatrix(); + + private: + class StateData { + public: + StateData(); + StateData(const StateData& that); + ~StateData(); + + CFX_ByteString m_BlendMode; + int m_BlendType; + CPDF_Object* m_pSoftMask; + CFX_Matrix m_SMaskMatrix; + FX_FLOAT m_StrokeAlpha; + FX_FLOAT m_FillAlpha; + CPDF_Object* m_pTR; + CPDF_TransferFunc* m_pTransferFunc; + CFX_Matrix m_Matrix; + int m_RenderIntent; + bool m_StrokeAdjust; + bool m_AlphaSource; + bool m_TextKnockout; + bool m_StrokeOP; + bool m_FillOP; + int m_OPMode; + CPDF_Object* m_pBG; + CPDF_Object* m_pUCR; + CPDF_Object* m_pHT; + FX_FLOAT m_Flatness; + FX_FLOAT m_Smoothness; + }; + + CFX_CountRef m_Ref; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_GENERALSTATE_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_graphicstates.h b/core/fpdfapi/fpdf_page/cpdf_graphicstates.h index 5059f3c5a4..f52aba27d8 100644 --- a/core/fpdfapi/fpdf_page/cpdf_graphicstates.h +++ b/core/fpdfapi/fpdf_page/cpdf_graphicstates.h @@ -7,10 +7,10 @@ #ifndef CORE_FPDFAPI_FPDF_PAGE_CPDF_GRAPHICSTATES_H_ #define CORE_FPDFAPI_FPDF_PAGE_CPDF_GRAPHICSTATES_H_ +#include "core/fpdfapi/fpdf_page/cpdf_clippath.h" #include "core/fpdfapi/fpdf_page/cpdf_colorstate.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_clippath.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_generalstate.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_textstate.h" +#include "core/fpdfapi/fpdf_page/cpdf_generalstate.h" +#include "core/fpdfapi/fpdf_page/cpdf_textstate.h" #include "core/fxge/include/cfx_graphstate.h" class CPDF_GraphicStates { diff --git a/core/fpdfapi/fpdf_page/cpdf_image.cpp b/core/fpdfapi/fpdf_page/cpdf_image.cpp index 91f1268eae..fc5ce8fd10 100644 --- a/core/fpdfapi/fpdf_page/cpdf_image.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_image.cpp @@ -4,13 +4,13 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_image.h" +#include "core/fpdfapi/fpdf_page/cpdf_image.h" #include #include #include -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/cpdf_boolean.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_image.h b/core/fpdfapi/fpdf_page/cpdf_image.h new file mode 100644 index 0000000000..bf4e73b4d8 --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_image.h @@ -0,0 +1,90 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_IMAGE_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_IMAGE_H_ + +#include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" +#include "core/fxcrt/include/fx_system.h" + +#define PDF_IMAGE_NO_COMPRESS 0x0000 +#define PDF_IMAGE_LOSSY_COMPRESS 0x0001 +#define PDF_IMAGE_LOSSLESS_COMPRESS 0x0002 +#define PDF_IMAGE_MASK_LOSSY_COMPRESS 0x0004 +#define PDF_IMAGE_MASK_LOSSLESS_COMPRESS 0x0008 + +class CFX_DIBitmap; +class CFX_DIBSource; +class CPDF_Dictionay; +class CPDF_Document; +class CPDF_Page; +class IFX_FileRead; +class IFX_FileWrite; +class IFX_Pause; + +class CPDF_Image { + public: + explicit CPDF_Image(CPDF_Document* pDoc); + CPDF_Image(CPDF_Document* pDoc, CPDF_Stream* pStream, bool bInline); + ~CPDF_Image(); + + CPDF_Image* Clone(); + + CPDF_Dictionary* GetInlineDict() const { return m_pInlineDict; } + CPDF_Stream* GetStream() const { return m_pStream; } + CPDF_Dictionary* GetDict() const { + return m_pStream ? m_pStream->GetDict() : nullptr; + } + CPDF_Dictionary* GetOC() const { return m_pOC; } + CPDF_Document* GetDocument() const { return m_pDocument; } + + int32_t GetPixelHeight() const { return m_Height; } + int32_t GetPixelWidth() const { return m_Width; } + + bool IsInline() const { return m_bInline; } + bool IsMask() const { return m_bIsMask; } + bool IsInterpol() const { return m_bInterpolate; } + + CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = nullptr, + uint32_t* pMatteColor = nullptr, + FX_BOOL bStdCS = FALSE, + uint32_t GroupFamily = 0, + FX_BOOL bLoadMask = FALSE) const; + + void SetInlineDict(CPDF_Dictionary* pDict) { m_pInlineDict = pDict; } + void SetImage(const CFX_DIBitmap* pDIBitmap, int32_t iCompress); + void SetJpegImage(IFX_FileRead* pFile); + + void ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pDIBitmap); + + FX_BOOL StartLoadDIBSource(CPDF_Dictionary* pFormResource, + CPDF_Dictionary* pPageResource, + FX_BOOL bStdCS = FALSE, + uint32_t GroupFamily = 0, + FX_BOOL bLoadMask = FALSE); + FX_BOOL Continue(IFX_Pause* pPause); + CFX_DIBSource* DetachBitmap(); + CFX_DIBSource* DetachMask(); + + CFX_DIBSource* m_pDIBSource; + CFX_DIBSource* m_pMask; + uint32_t m_MatteColor; + + private: + CPDF_Dictionary* InitJPEG(uint8_t* pData, uint32_t size); + + CPDF_Stream* m_pStream; + const bool m_bInline; + CPDF_Dictionary* m_pInlineDict; + int32_t m_Height; + int32_t m_Width; + bool m_bIsMask; + bool m_bInterpolate; + CPDF_Document* const m_pDocument; + CPDF_Dictionary* m_pOC; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_IMAGE_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_imageobject.cpp b/core/fpdfapi/fpdf_page/cpdf_imageobject.cpp index 1fa14805aa..b8db154bef 100644 --- a/core/fpdfapi/fpdf_page/cpdf_imageobject.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_imageobject.cpp @@ -4,11 +4,11 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_imageobject.h" #include -#include "core/fpdfapi/fpdf_page/include/cpdf_image.h" +#include "core/fpdfapi/fpdf_page/cpdf_image.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_imageobject.h b/core/fpdfapi/fpdf_page/cpdf_imageobject.h new file mode 100644 index 0000000000..98ef8c8e4b --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_imageobject.h @@ -0,0 +1,44 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_IMAGEOBJECT_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_IMAGEOBJECT_H_ + +#include + +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fxcrt/include/fx_coordinates.h" + +class CPDF_Image; + +class CPDF_ImageObject : public CPDF_PageObject { + public: + CPDF_ImageObject(); + ~CPDF_ImageObject() override; + + // CPDF_PageObject + CPDF_ImageObject* Clone() const override; + Type GetType() const override; + void Transform(const CFX_Matrix& matrix) override; + bool IsImage() const override; + CPDF_ImageObject* AsImage() override; + const CPDF_ImageObject* AsImage() const override; + + void CalcBoundingBox(); + CPDF_Image* GetImage() const { return m_pImage; } + void SetOwnedImage(std::unique_ptr pImage); + void SetUnownedImage(CPDF_Image* pImage); + + CFX_Matrix m_Matrix; + + private: + void Release(); + + CPDF_Image* m_pImage; + bool m_pImageOwned; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_IMAGEOBJECT_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_meshstream.cpp b/core/fpdfapi/fpdf_page/cpdf_meshstream.cpp index d2dfac34be..a9da92ed22 100644 --- a/core/fpdfapi/fpdf_page/cpdf_meshstream.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_meshstream.cpp @@ -6,7 +6,7 @@ #include "core/fpdfapi/fpdf_page/cpdf_meshstream.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_colorspace.h" +#include "core/fpdfapi/fpdf_page/cpdf_colorspace.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_page.cpp b/core/fpdfapi/fpdf_page/cpdf_page.cpp index b9931713c4..13a44ba88c 100644 --- a/core/fpdfapi/fpdf_page/cpdf_page.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_page.cpp @@ -4,11 +4,11 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_page.h b/core/fpdfapi/fpdf_page/cpdf_page.h new file mode 100644 index 0000000000..814c1563de --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_page.h @@ -0,0 +1,69 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_PAGE_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_PAGE_H_ + +#include + +#include "core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h" +#include "core/fxcrt/include/fx_basic.h" +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_system.h" + +class CPDF_Dictionary; +class CPDF_Document; +class CPDF_Object; +class CPDF_PageRenderCache; +class CPDF_PageRenderContext; + +class CPDF_Page : public CPDF_PageObjectHolder { + public: + class View {}; // Caller implements as desired, empty here due to layering. + + CPDF_Page(CPDF_Document* pDocument, + CPDF_Dictionary* pPageDict, + bool bPageCache); + ~CPDF_Page() override; + + void ParseContent(); + + void GetDisplayMatrix(CFX_Matrix& matrix, + int xPos, + int yPos, + int xSize, + int ySize, + int iRotate) const; + + FX_FLOAT GetPageWidth() const { return m_PageWidth; } + FX_FLOAT GetPageHeight() const { return m_PageHeight; } + CFX_FloatRect GetPageBBox() const { return m_BBox; } + const CFX_Matrix& GetPageMatrix() const { return m_PageMatrix; } + CPDF_Object* GetPageAttr(const CFX_ByteString& name) const; + CPDF_PageRenderCache* GetRenderCache() const { return m_pPageRender.get(); } + + CPDF_PageRenderContext* GetRenderContext() const { + return m_pRenderContext.get(); + } + void SetRenderContext(std::unique_ptr pContext); + + View* GetView() const { return m_pView; } + void SetView(View* pView) { m_pView = pView; } + + protected: + friend class CPDF_ContentParser; + + void StartParse(); + + FX_FLOAT m_PageWidth; + FX_FLOAT m_PageHeight; + CFX_Matrix m_PageMatrix; + View* m_pView; + std::unique_ptr m_pPageRender; + std::unique_ptr m_pRenderContext; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_PAGE_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_pagemodule.h b/core/fpdfapi/fpdf_page/cpdf_pagemodule.h index 2e418f8993..c1f0ede1ba 100644 --- a/core/fpdfapi/fpdf_page/cpdf_pagemodule.h +++ b/core/fpdfapi/fpdf_page/cpdf_pagemodule.h @@ -8,7 +8,7 @@ #define CORE_FPDFAPI_FPDF_PAGE_CPDF_PAGEMODULE_H_ #include "core/fpdfapi/fpdf_font/font_int.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_colorspace.h" +#include "core/fpdfapi/fpdf_page/cpdf_colorspace.h" #include "core/fpdfapi/fpdf_page/pageint.h" class CPDF_Document; diff --git a/core/fpdfapi/fpdf_page/cpdf_pageobject.cpp b/core/fpdfapi/fpdf_page/cpdf_pageobject.cpp index 4566d97771..4015587304 100644 --- a/core/fpdfapi/fpdf_page/cpdf_pageobject.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_pageobject.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" CPDF_PageObject::CPDF_PageObject() {} diff --git a/core/fpdfapi/fpdf_page/cpdf_pageobject.h b/core/fpdfapi/fpdf_page/cpdf_pageobject.h new file mode 100644 index 0000000000..8bf47f034b --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_pageobject.h @@ -0,0 +1,71 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_PAGEOBJECT_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_PAGEOBJECT_H_ + +#include "core/fpdfapi/fpdf_page/cpdf_contentmark.h" +#include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h" +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_system.h" + +class CPDF_TextObject; +class CPDF_PathObject; +class CPDF_ImageObject; +class CPDF_ShadingObject; +class CPDF_FormObject; + +class CPDF_PageObject : public CPDF_GraphicStates { + public: + enum Type { + TEXT = 1, + PATH, + IMAGE, + SHADING, + FORM, + }; + + CPDF_PageObject(); + ~CPDF_PageObject() override; + + virtual CPDF_PageObject* Clone() const = 0; + virtual Type GetType() const = 0; + virtual void Transform(const CFX_Matrix& matrix) = 0; + virtual bool IsText() const; + virtual bool IsPath() const; + virtual bool IsImage() const; + virtual bool IsShading() const; + virtual bool IsForm() const; + virtual CPDF_TextObject* AsText(); + virtual const CPDF_TextObject* AsText() const; + virtual CPDF_PathObject* AsPath(); + virtual const CPDF_PathObject* AsPath() const; + virtual CPDF_ImageObject* AsImage(); + virtual const CPDF_ImageObject* AsImage() const; + virtual CPDF_ShadingObject* AsShading(); + virtual const CPDF_ShadingObject* AsShading() const; + virtual CPDF_FormObject* AsForm(); + virtual const CPDF_FormObject* AsForm() const; + + void TransformClipPath(CFX_Matrix& matrix); + void TransformGeneralState(CFX_Matrix& matrix); + FX_RECT GetBBox(const CFX_Matrix* pMatrix) const; + + FX_FLOAT m_Left; + FX_FLOAT m_Right; + FX_FLOAT m_Top; + FX_FLOAT m_Bottom; + CPDF_ContentMark m_ContentMark; + + protected: + void CopyData(const CPDF_PageObject* pSrcObject); + + private: + CPDF_PageObject(const CPDF_PageObject& src) = delete; + void operator=(const CPDF_PageObject& src) = delete; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_PAGEOBJECT_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_pageobjectholder.cpp b/core/fpdfapi/fpdf_page/cpdf_pageobjectholder.cpp index eb7cb8e2f5..115cf4694b 100644 --- a/core/fpdfapi/fpdf_page/cpdf_pageobjectholder.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_pageobjectholder.cpp @@ -4,9 +4,9 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h b/core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h new file mode 100644 index 0000000000..36379bed15 --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h @@ -0,0 +1,68 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_PAGEOBJECTHOLDER_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_PAGEOBJECTHOLDER_H_ + +#include "core/fpdfapi/fpdf_page/cpdf_pageobjectlist.h" +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_system.h" + +class IFX_Pause; +class CPDF_Dictionary; +class CPDF_Stream; +class CPDF_Document; +class CPDF_ContentParser; + +#define PDFTRANS_GROUP 0x0100 +#define PDFTRANS_ISOLATED 0x0200 +#define PDFTRANS_KNOCKOUT 0x0400 + +class CPDF_PageObjectHolder { + public: + CPDF_PageObjectHolder(); + virtual ~CPDF_PageObjectHolder(); + + void ContinueParse(IFX_Pause* pPause); + bool IsParsed() const { return m_ParseState == CONTENT_PARSED; } + + CPDF_PageObjectList* GetPageObjectList() { return &m_PageObjectList; } + const CPDF_PageObjectList* GetPageObjectList() const { + return &m_PageObjectList; + } + + FX_BOOL BackgroundAlphaNeeded() const { return m_bBackgroundAlphaNeeded; } + void SetBackgroundAlphaNeeded(FX_BOOL needed) { + m_bBackgroundAlphaNeeded = needed; + } + + FX_BOOL HasImageMask() const { return m_bHasImageMask; } + void SetHasImageMask(FX_BOOL value) { m_bHasImageMask = value; } + + void Transform(const CFX_Matrix& matrix); + CFX_FloatRect CalcBoundingBox() const; + + CPDF_Dictionary* m_pFormDict; + CPDF_Stream* m_pFormStream; + CPDF_Document* m_pDocument; + CPDF_Dictionary* m_pPageResources; + CPDF_Dictionary* m_pResources; + CFX_FloatRect m_BBox; + int m_Transparency; + + protected: + enum ParseState { CONTENT_NOT_PARSED, CONTENT_PARSING, CONTENT_PARSED }; + + void LoadTransInfo(); + + FX_BOOL m_bBackgroundAlphaNeeded; + FX_BOOL m_bHasImageMask; + ParseState m_ParseState; + std::unique_ptr m_pParser; + CPDF_PageObjectList m_PageObjectList; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_PAGEOBJECTHOLDER_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_path.cpp b/core/fpdfapi/fpdf_page/cpdf_path.cpp index 6fcc7d3ec3..2c80cc3d12 100644 --- a/core/fpdfapi/fpdf_page/cpdf_path.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_path.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_path.h" +#include "core/fpdfapi/fpdf_page/cpdf_path.h" CPDF_Path::CPDF_Path() {} diff --git a/core/fpdfapi/fpdf_page/cpdf_path.h b/core/fpdfapi/fpdf_page/cpdf_path.h new file mode 100644 index 0000000000..304a489b2e --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_path.h @@ -0,0 +1,50 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_PATH_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_PATH_H_ + +#include "core/fxcrt/include/cfx_count_ref.h" +#include "core/fxcrt/include/fx_system.h" +#include "core/fxge/include/cfx_fxgedevice.h" +#include "core/fxge/include/cfx_pathdata.h" +#include "core/fxge/include/cfx_renderdevice.h" + +class CPDF_Path { + public: + CPDF_Path(); + CPDF_Path(const CPDF_Path& that); + ~CPDF_Path(); + + void Emplace() { m_Ref.Emplace(); } + explicit operator bool() const { return !!m_Ref; } + + int GetPointCount() const; + void SetPointCount(int count); + const FX_PATHPOINT* GetPoints() const; + FX_PATHPOINT* GetMutablePoints(); + + int GetFlag(int index) const; + FX_FLOAT GetPointX(int index) const; + FX_FLOAT GetPointY(int index) const; + CFX_FloatRect GetBoundingBox() const; + CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const; + + FX_BOOL IsRect() const; + void Transform(const CFX_Matrix* pMatrix); + + void Append(const CPDF_Path& other, const CFX_Matrix* pMatrix); + void Append(const CFX_PathData* pData, const CFX_Matrix* pMatrix); + void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top); + + // TODO(tsepez): Remove when all access thru this class. + const CFX_PathData* GetObject() const { return m_Ref.GetObject(); } + + private: + CFX_CountRef m_Ref; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_PATH_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_pathobject.cpp b/core/fpdfapi/fpdf_page/cpdf_pathobject.cpp index 946d934edb..94385de6e0 100644 --- a/core/fpdfapi/fpdf_page/cpdf_pathobject.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_pathobject.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pathobject.h" CPDF_PathObject::CPDF_PathObject() {} diff --git a/core/fpdfapi/fpdf_page/cpdf_pathobject.h b/core/fpdfapi/fpdf_page/cpdf_pathobject.h new file mode 100644 index 0000000000..3144ecb24c --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_pathobject.h @@ -0,0 +1,36 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_PATHOBJECT_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_PATHOBJECT_H_ + +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_path.h" +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_system.h" + +class CPDF_PathObject : public CPDF_PageObject { + public: + CPDF_PathObject(); + ~CPDF_PathObject() override; + + // CPDF_PageObject + CPDF_PathObject* Clone() const override; + Type GetType() const override; + void Transform(const CFX_Matrix& maxtrix) override; + bool IsPath() const override; + CPDF_PathObject* AsPath() override; + const CPDF_PathObject* AsPath() const override; + + void CalcBoundingBox(); + + CPDF_Path m_Path; + int m_FillType; + FX_BOOL m_bStroke; + CFX_Matrix m_Matrix; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_PATHOBJECT_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_shadingobject.cpp b/core/fpdfapi/fpdf_page/cpdf_shadingobject.cpp index 03dd22c134..f2e7d97a96 100644 --- a/core/fpdfapi/fpdf_page/cpdf_shadingobject.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_shadingobject.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_shadingobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_shadingobject.h" #include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h" #include "core/fpdfapi/fpdf_page/pageint.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_shadingobject.h b/core/fpdfapi/fpdf_page/cpdf_shadingobject.h new file mode 100644 index 0000000000..2f1abf7c5d --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_shadingobject.h @@ -0,0 +1,34 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_SHADINGOBJECT_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_SHADINGOBJECT_H_ + +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fxcrt/include/fx_coordinates.h" + +class CPDF_ShadingPattern; + +class CPDF_ShadingObject : public CPDF_PageObject { + public: + CPDF_ShadingObject(); + ~CPDF_ShadingObject() override; + + // CPDF_PageObject + CPDF_ShadingObject* Clone() const override; + Type GetType() const override; + void Transform(const CFX_Matrix& matrix) override; + bool IsShading() const override; + CPDF_ShadingObject* AsShading() override; + const CPDF_ShadingObject* AsShading() const override; + + void CalcBoundingBox(); + + CPDF_ShadingPattern* m_pShading; + CFX_Matrix m_Matrix; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_SHADINGOBJECT_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp index e027dee8c3..4b9f335ea3 100644 --- a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_textobject.h" #include "core/fpdfapi/fpdf_font/cpdf_cidfont.h" #include "core/fpdfapi/fpdf_font/cpdf_font.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_textobject.h b/core/fpdfapi/fpdf_page/cpdf_textobject.h new file mode 100644 index 0000000000..51700f5556 --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_textobject.h @@ -0,0 +1,69 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_TEXTOBJECT_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_TEXTOBJECT_H_ + +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fxcrt/include/fx_string.h" +#include "core/fxcrt/include/fx_system.h" + +struct CPDF_TextObjectItem { + uint32_t m_CharCode; + FX_FLOAT m_OriginX; + FX_FLOAT m_OriginY; +}; + +class CPDF_TextObject : public CPDF_PageObject { + public: + CPDF_TextObject(); + ~CPDF_TextObject() override; + + // CPDF_PageObject + CPDF_TextObject* Clone() const override; + Type GetType() const override; + void Transform(const CFX_Matrix& matrix) override; + bool IsText() const override; + CPDF_TextObject* AsText() override; + const CPDF_TextObject* AsText() const override; + + int CountItems() const; + void GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const; + int CountChars() const; + void GetCharInfo(int index, uint32_t& charcode, FX_FLOAT& kerning) const; + void GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const; + FX_FLOAT GetCharWidth(uint32_t charcode) const; + FX_FLOAT GetPosX() const; + FX_FLOAT GetPosY() const; + void GetTextMatrix(CFX_Matrix* pMatrix) const; + CPDF_Font* GetFont() const; + FX_FLOAT GetFontSize() const; + + void SetText(const CFX_ByteString& text); + void SetPosition(FX_FLOAT x, FX_FLOAT y); + + void RecalcPositionData(); + + protected: + friend class CPDF_RenderStatus; + friend class CPDF_StreamContentParser; + friend class CPDF_TextRenderer; + + void SetSegments(const CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs); + + void CalcPositionData(FX_FLOAT* pTextAdvanceX, + FX_FLOAT* pTextAdvanceY, + FX_FLOAT horz_scale, + int level = 0); + + FX_FLOAT m_PosX; + FX_FLOAT m_PosY; + int m_nChars; + uint32_t* m_pCharCodes; + FX_FLOAT* m_pCharPos; +}; + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_TEXTOBJECT_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_textstate.cpp b/core/fpdfapi/fpdf_page/cpdf_textstate.cpp index 45281a7b8f..394af9ec86 100644 --- a/core/fpdfapi/fpdf_page/cpdf_textstate.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_textstate.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfapi/fpdf_page/include/cpdf_textstate.h" +#include "core/fpdfapi/fpdf_page/cpdf_textstate.h" #include "core/fpdfapi/fpdf_font/cpdf_font.h" #include "core/fpdfapi/fpdf_page/pageint.h" diff --git a/core/fpdfapi/fpdf_page/cpdf_textstate.h b/core/fpdfapi/fpdf_page/cpdf_textstate.h new file mode 100644 index 0000000000..a10c81d9f4 --- /dev/null +++ b/core/fpdfapi/fpdf_page/cpdf_textstate.h @@ -0,0 +1,91 @@ +// 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_TEXTSTATE_H_ +#define CORE_FPDFAPI_FPDF_PAGE_CPDF_TEXTSTATE_H_ + +#include "core/fxcrt/include/cfx_count_ref.h" +#include "core/fxcrt/include/fx_basic.h" + +class CPDF_Document; +class CPDF_Font; + +// See PDF Reference 1.7, page 402, table 5.3. +enum class TextRenderingMode { + MODE_FILL = 0, + MODE_STROKE = 1, + MODE_FILL_STROKE = 2, + MODE_INVISIBLE = 3, + MODE_FILL_CLIP = 4, + MODE_STROKE_CLIP = 5, + MODE_FILL_STROKE_CLIP = 6, + MODE_CLIP = 7, +}; + +class CPDF_TextState { + public: + CPDF_TextState(); + ~CPDF_TextState(); + + void Emplace(); + + CPDF_Font* GetFont() const; + void SetFont(CPDF_Font* pFont); + + FX_FLOAT GetFontSize() const; + void SetFontSize(FX_FLOAT size); + + const FX_FLOAT* GetMatrix() const; + FX_FLOAT* GetMutableMatrix(); + + FX_FLOAT GetCharSpace() const; + void SetCharSpace(FX_FLOAT sp); + + FX_FLOAT GetWordSpace() const; + void SetWordSpace(FX_FLOAT sp); + + FX_FLOAT GetFontSizeV() const; + FX_FLOAT GetFontSizeH() const; + FX_FLOAT GetBaselineAngle() const; + FX_FLOAT GetShearAngle() const; + + TextRenderingMode GetTextMode() const; + void SetTextMode(TextRenderingMode mode); + + const FX_FLOAT* GetCTM() const; + FX_FLOAT* GetMutableCTM(); + + private: + class TextData { + public: + TextData(); + TextData(const TextData& src); + ~TextData(); + + void SetFont(CPDF_Font* pFont); + FX_FLOAT GetFontSizeV() const; + FX_FLOAT GetFontSizeH() const; + FX_FLOAT GetBaselineAngle() const; + FX_FLOAT GetShearAngle() const; + + CPDF_Font* m_pFont; + CPDF_Document* m_pDocument; + FX_FLOAT m_FontSize; + FX_FLOAT m_CharSpace; + FX_FLOAT m_WordSpace; + TextRenderingMode m_TextMode; + FX_FLOAT m_Matrix[4]; + FX_FLOAT m_CTM[4]; + }; + + CFX_CountRef m_Ref; +}; + +bool SetTextRenderingModeFromInt(int iMode, TextRenderingMode* mode); +bool TextRenderingModeIsClipMode(const TextRenderingMode& mode); +bool TextRenderingModeIsStrokeMode(const TextRenderingMode& mode); + +#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_TEXTSTATE_H_ diff --git a/core/fpdfapi/fpdf_page/cpdf_tilingpattern.cpp b/core/fpdfapi/fpdf_page/cpdf_tilingpattern.cpp index 7c1716dc01..dd80487148 100644 --- a/core/fpdfapi/fpdf_page/cpdf_tilingpattern.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_tilingpattern.cpp @@ -6,7 +6,7 @@ #include "core/fpdfapi/fpdf_page/cpdf_tilingpattern.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" diff --git a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp index bd217fcf99..ba20c7a9f1 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp @@ -12,11 +12,11 @@ #include "core/fdrm/crypto/fx_crypt.h" #include "core/fpdfapi/fpdf_font/cpdf_type1font.h" #include "core/fpdfapi/fpdf_font/font_int.h" +#include "core/fpdfapi/fpdf_page/cpdf_image.h" #include "core/fpdfapi/fpdf_page/cpdf_pagemodule.h" #include "core/fpdfapi/fpdf_page/cpdf_pattern.h" #include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h" #include "core/fpdfapi/fpdf_page/cpdf_tilingpattern.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_image.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp index 5cd06244ed..3a8fb73d24 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp @@ -14,16 +14,16 @@ #include "core/fpdfapi/fpdf_font/cpdf_font.h" #include "core/fpdfapi/fpdf_font/cpdf_type3font.h" #include "core/fpdfapi/fpdf_page/cpdf_allstates.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_formobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_image.h" +#include "core/fpdfapi/fpdf_page/cpdf_imageobject.h" #include "core/fpdfapi/fpdf_page/cpdf_meshstream.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pathobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_shadingobject.h" #include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_formobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_image.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_shadingobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_textobject.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp index 0e9cd3b55d..244fe76353 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp @@ -10,10 +10,10 @@ #include "core/fpdfapi/fpdf_font/cpdf_type3char.h" #include "core/fpdfapi/fpdf_page/cpdf_allstates.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_path.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_path.h" #include "core/fpdfapi/fpdf_parser/cpdf_boolean.h" #include "core/fpdfapi/fpdf_parser/cpdf_null.h" #include "core/fpdfapi/fpdf_parser/fpdf_parser_utility.h" diff --git a/core/fpdfapi/fpdf_page/include/cpdf_clippath.h b/core/fpdfapi/fpdf_page/include/cpdf_clippath.h deleted file mode 100644 index 6b3cca0d41..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_clippath.h +++ /dev/null @@ -1,63 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_CLIPPATH_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_CLIPPATH_H_ - -#include -#include -#include - -#include "core/fpdfapi/fpdf_page/include/cpdf_path.h" -#include "core/fxcrt/include/cfx_count_ref.h" -#include "core/fxcrt/include/fx_basic.h" -#include "core/fxcrt/include/fx_coordinates.h" - -class CPDF_Path; -class CPDF_TextObject; - -class CPDF_ClipPath { - public: - CPDF_ClipPath(); - CPDF_ClipPath(const CPDF_ClipPath& that); - ~CPDF_ClipPath(); - - void Emplace() { m_Ref.Emplace(); } - void SetNull() { m_Ref.SetNull(); } - - explicit operator bool() const { return !!m_Ref; } - bool operator==(const CPDF_ClipPath& that) const { - return m_Ref == that.m_Ref; - } - bool operator!=(const CPDF_ClipPath& that) const { return !(*this == that); } - - uint32_t GetPathCount() const; - CPDF_Path GetPath(size_t i) const; - uint8_t GetClipType(size_t i) const; - uint32_t GetTextCount() const; - CPDF_TextObject* GetText(size_t i) const; - CFX_FloatRect GetClipBox() const; - void AppendPath(CPDF_Path path, uint8_t type, bool bAutoMerge); - void AppendTexts(std::vector>* pTexts); - void Transform(const CFX_Matrix& matrix); - - private: - class PathData { - public: - using PathAndTypeData = std::pair; - - PathData(); - PathData(const PathData& that); - ~PathData(); - - std::vector m_PathAndTypeList; - std::vector> m_TextList; - }; - - CFX_CountRef m_Ref; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_CLIPPATH_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_color.h b/core/fpdfapi/fpdf_page/include/cpdf_color.h deleted file mode 100644 index 89c0eac730..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_color.h +++ /dev/null @@ -1,41 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLOR_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLOR_H_ - -#include "core/fpdfapi/fpdf_page/include/cpdf_colorspace.h" -#include "core/fxcrt/include/fx_system.h" - -class CPDF_Pattern; - -class CPDF_Color { - public: - CPDF_Color(); - ~CPDF_Color(); - - bool IsNull() const { return !m_pBuffer; } - bool IsPattern() const; - - void Copy(const CPDF_Color* pSrc); - - void SetColorSpace(CPDF_ColorSpace* pCS); - void SetValue(FX_FLOAT* comp); - void SetValue(CPDF_Pattern* pPattern, FX_FLOAT* comp, int ncomps); - - FX_BOOL GetRGB(int& R, int& G, int& B) const; - CPDF_Pattern* GetPattern() const; - const CPDF_ColorSpace* GetColorSpace() const { return m_pCS; } - - protected: - void ReleaseBuffer(); - void ReleaseColorSpace(); - - CPDF_ColorSpace* m_pCS; - FX_FLOAT* m_pBuffer; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLOR_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_colorspace.h b/core/fpdfapi/fpdf_page/include/cpdf_colorspace.h deleted file mode 100644 index 19aadbf704..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_colorspace.h +++ /dev/null @@ -1,121 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_ - -#include - -#include "core/fxcrt/include/fx_string.h" -#include "core/fxcrt/include/fx_system.h" - -#define PDFCS_DEVICEGRAY 1 -#define PDFCS_DEVICERGB 2 -#define PDFCS_DEVICECMYK 3 -#define PDFCS_CALGRAY 4 -#define PDFCS_CALRGB 5 -#define PDFCS_LAB 6 -#define PDFCS_ICCBASED 7 -#define PDFCS_SEPARATION 8 -#define PDFCS_DEVICEN 9 -#define PDFCS_INDEXED 10 -#define PDFCS_PATTERN 11 - -class CPDF_Array; -class CPDF_Document; -class CPDF_Object; - -class CPDF_ColorSpace { - public: - static CPDF_ColorSpace* GetStockCS(int Family); - static CPDF_ColorSpace* ColorspaceFromName(const CFX_ByteString& name); - static std::unique_ptr Load(CPDF_Document* pDoc, - CPDF_Object* pCSObj); - - void Release(); - - int GetBufSize() const; - FX_FLOAT* CreateBuf(); - void GetDefaultColor(FX_FLOAT* buf) const; - uint32_t CountComponents() const; - int GetFamily() const { return m_Family; } - virtual void GetDefaultValue(int iComponent, - FX_FLOAT& value, - FX_FLOAT& min, - FX_FLOAT& max) const; - - FX_BOOL sRGB() const; - virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, - FX_FLOAT& R, - FX_FLOAT& G, - FX_FLOAT& B) const = 0; - virtual FX_BOOL SetRGB(FX_FLOAT* pBuf, - FX_FLOAT R, - FX_FLOAT G, - FX_FLOAT B) const; - - FX_BOOL GetCMYK(FX_FLOAT* pBuf, - FX_FLOAT& c, - FX_FLOAT& m, - FX_FLOAT& y, - FX_FLOAT& k) const; - FX_BOOL SetCMYK(FX_FLOAT* pBuf, - FX_FLOAT c, - FX_FLOAT m, - FX_FLOAT y, - FX_FLOAT k) const; - - virtual void TranslateImageLine(uint8_t* dest_buf, - const uint8_t* src_buf, - int pixels, - int image_width, - int image_height, - FX_BOOL bTransMask = FALSE) const; - - CPDF_Array*& GetArray() { return m_pArray; } - virtual CPDF_ColorSpace* GetBaseCS() const; - - virtual void EnableStdConversion(FX_BOOL bEnabled); - - CPDF_Document* const m_pDocument; - - protected: - CPDF_ColorSpace(CPDF_Document* pDoc, int family, uint32_t nComponents); - virtual ~CPDF_ColorSpace(); - - virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray); - virtual FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, - FX_FLOAT& c, - FX_FLOAT& m, - FX_FLOAT& y, - FX_FLOAT& k) const; - virtual FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, - FX_FLOAT c, - FX_FLOAT m, - FX_FLOAT y, - FX_FLOAT k) const; - - int m_Family; - uint32_t m_nComponents; - CPDF_Array* m_pArray; - uint32_t m_dwStdConversion; -}; - -namespace std { - -// Make std::unique_ptr call Release() rather than -// simply deleting the object. -template <> -struct default_delete { - void operator()(CPDF_ColorSpace* pColorSpace) const { - if (pColorSpace) - pColorSpace->Release(); - } -}; - -} // namespace std - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_form.h b/core/fpdfapi/fpdf_page/include/cpdf_form.h deleted file mode 100644 index c2cba0eb13..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_form.h +++ /dev/null @@ -1,41 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_FORM_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_FORM_H_ - -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" - -class CPDF_Document; -class CPDF_Dictionary; -class CPDF_Stream; -class CPDF_AllStates; -class CFX_Matrix; -class CPDF_Type3Char; - -class CPDF_Form : public CPDF_PageObjectHolder { - public: - CPDF_Form(CPDF_Document* pDocument, - CPDF_Dictionary* pPageResources, - CPDF_Stream* pFormStream, - CPDF_Dictionary* pParentResources = nullptr); - ~CPDF_Form() override; - - void ParseContent(CPDF_AllStates* pGraphicStates, - const CFX_Matrix* pParentMatrix, - CPDF_Type3Char* pType3Char, - int level = 0); - - CPDF_Form* Clone() const; - - private: - void StartParse(CPDF_AllStates* pGraphicStates, - const CFX_Matrix* pParentMatrix, - CPDF_Type3Char* pType3Char, - int level = 0); -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_FORM_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_formobject.h b/core/fpdfapi/fpdf_page/include/cpdf_formobject.h deleted file mode 100644 index 5b146b268d..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_formobject.h +++ /dev/null @@ -1,37 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_FORMOBJECT_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_FORMOBJECT_H_ - -#include - -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fxcrt/include/fx_coordinates.h" - -class CPDF_Form; - -class CPDF_FormObject : public CPDF_PageObject { - public: - CPDF_FormObject(); - ~CPDF_FormObject() override; - - // CPDF_PageObject: - CPDF_FormObject* Clone() const override; - Type GetType() const override; - void Transform(const CFX_Matrix& matrix) override; - bool IsForm() const override; - CPDF_FormObject* AsForm() override; - const CPDF_FormObject* AsForm() const override; - - void CalcBoundingBox(); - const CPDF_Form* form() const { return m_pForm.get(); } - - std::unique_ptr m_pForm; - CFX_Matrix m_FormMatrix; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_FORMOBJECT_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h b/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h deleted file mode 100644 index 1cd2d815c8..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h +++ /dev/null @@ -1,109 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ - -#include "core/fxcrt/include/fx_basic.h" -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxge/include/fx_dib.h" - -class CPDF_Object; -class CPDF_TransferFunc; - -class CPDF_GeneralState { - public: - CPDF_GeneralState(); - CPDF_GeneralState(const CPDF_GeneralState& that); - ~CPDF_GeneralState(); - - void Emplace() { m_Ref.Emplace(); } - explicit operator bool() const { return !!m_Ref; } - - void SetRenderIntent(const CFX_ByteString& ri); - - int GetBlendType() const; - void SetBlendType(int type); - - FX_FLOAT GetFillAlpha() const; - void SetFillAlpha(FX_FLOAT alpha); - - FX_FLOAT GetStrokeAlpha() const; - void SetStrokeAlpha(FX_FLOAT alpha); - - CPDF_Object* GetSoftMask() const; - void SetSoftMask(CPDF_Object* pObject); - - CPDF_Object* GetTR() const; - void SetTR(CPDF_Object* pObject); - - CPDF_TransferFunc* GetTransferFunc() const; - void SetTransferFunc(CPDF_TransferFunc* pFunc); - - void SetBlendMode(const CFX_ByteString& mode); - - const CFX_Matrix* GetSMaskMatrix() const; - void SetSMaskMatrix(const CFX_Matrix& matrix); - - bool GetFillOP() const; - void SetFillOP(bool op); - - bool GetStrokeOP() const; - void SetStrokeOP(bool op); - - int GetOPMode() const; - void SetOPMode(int mode); - - void SetBG(CPDF_Object* pObject); - void SetUCR(CPDF_Object* pObject); - void SetHT(CPDF_Object* pObject); - - void SetFlatness(FX_FLOAT flatness); - void SetSmoothness(FX_FLOAT smoothness); - - bool GetStrokeAdjust() const; - void SetStrokeAdjust(bool adjust); - - void SetAlphaSource(bool source); - void SetTextKnockout(bool knockout); - - void SetMatrix(const CFX_Matrix& matrix); - CFX_Matrix* GetMutableMatrix(); - - private: - class StateData { - public: - StateData(); - StateData(const StateData& that); - ~StateData(); - - CFX_ByteString m_BlendMode; - int m_BlendType; - CPDF_Object* m_pSoftMask; - CFX_Matrix m_SMaskMatrix; - FX_FLOAT m_StrokeAlpha; - FX_FLOAT m_FillAlpha; - CPDF_Object* m_pTR; - CPDF_TransferFunc* m_pTransferFunc; - CFX_Matrix m_Matrix; - int m_RenderIntent; - bool m_StrokeAdjust; - bool m_AlphaSource; - bool m_TextKnockout; - bool m_StrokeOP; - bool m_FillOP; - int m_OPMode; - CPDF_Object* m_pBG; - CPDF_Object* m_pUCR; - CPDF_Object* m_pHT; - FX_FLOAT m_Flatness; - FX_FLOAT m_Smoothness; - }; - - CFX_CountRef m_Ref; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_image.h b/core/fpdfapi/fpdf_page/include/cpdf_image.h deleted file mode 100644 index ef48a04f95..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_image.h +++ /dev/null @@ -1,90 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_IMAGE_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_IMAGE_H_ - -#include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" -#include "core/fxcrt/include/fx_system.h" - -#define PDF_IMAGE_NO_COMPRESS 0x0000 -#define PDF_IMAGE_LOSSY_COMPRESS 0x0001 -#define PDF_IMAGE_LOSSLESS_COMPRESS 0x0002 -#define PDF_IMAGE_MASK_LOSSY_COMPRESS 0x0004 -#define PDF_IMAGE_MASK_LOSSLESS_COMPRESS 0x0008 - -class CFX_DIBitmap; -class CFX_DIBSource; -class CPDF_Dictionay; -class CPDF_Document; -class CPDF_Page; -class IFX_FileRead; -class IFX_FileWrite; -class IFX_Pause; - -class CPDF_Image { - public: - explicit CPDF_Image(CPDF_Document* pDoc); - CPDF_Image(CPDF_Document* pDoc, CPDF_Stream* pStream, bool bInline); - ~CPDF_Image(); - - CPDF_Image* Clone(); - - CPDF_Dictionary* GetInlineDict() const { return m_pInlineDict; } - CPDF_Stream* GetStream() const { return m_pStream; } - CPDF_Dictionary* GetDict() const { - return m_pStream ? m_pStream->GetDict() : nullptr; - } - CPDF_Dictionary* GetOC() const { return m_pOC; } - CPDF_Document* GetDocument() const { return m_pDocument; } - - int32_t GetPixelHeight() const { return m_Height; } - int32_t GetPixelWidth() const { return m_Width; } - - bool IsInline() const { return m_bInline; } - bool IsMask() const { return m_bIsMask; } - bool IsInterpol() const { return m_bInterpolate; } - - CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = nullptr, - uint32_t* pMatteColor = nullptr, - FX_BOOL bStdCS = FALSE, - uint32_t GroupFamily = 0, - FX_BOOL bLoadMask = FALSE) const; - - void SetInlineDict(CPDF_Dictionary* pDict) { m_pInlineDict = pDict; } - void SetImage(const CFX_DIBitmap* pDIBitmap, int32_t iCompress); - void SetJpegImage(IFX_FileRead* pFile); - - void ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pDIBitmap); - - FX_BOOL StartLoadDIBSource(CPDF_Dictionary* pFormResource, - CPDF_Dictionary* pPageResource, - FX_BOOL bStdCS = FALSE, - uint32_t GroupFamily = 0, - FX_BOOL bLoadMask = FALSE); - FX_BOOL Continue(IFX_Pause* pPause); - CFX_DIBSource* DetachBitmap(); - CFX_DIBSource* DetachMask(); - - CFX_DIBSource* m_pDIBSource; - CFX_DIBSource* m_pMask; - uint32_t m_MatteColor; - - private: - CPDF_Dictionary* InitJPEG(uint8_t* pData, uint32_t size); - - CPDF_Stream* m_pStream; - const bool m_bInline; - CPDF_Dictionary* m_pInlineDict; - int32_t m_Height; - int32_t m_Width; - bool m_bIsMask; - bool m_bInterpolate; - CPDF_Document* const m_pDocument; - CPDF_Dictionary* m_pOC; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_IMAGE_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_imageobject.h b/core/fpdfapi/fpdf_page/include/cpdf_imageobject.h deleted file mode 100644 index fdbd43c4a9..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_imageobject.h +++ /dev/null @@ -1,44 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_IMAGEOBJECT_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_IMAGEOBJECT_H_ - -#include - -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fxcrt/include/fx_coordinates.h" - -class CPDF_Image; - -class CPDF_ImageObject : public CPDF_PageObject { - public: - CPDF_ImageObject(); - ~CPDF_ImageObject() override; - - // CPDF_PageObject - CPDF_ImageObject* Clone() const override; - Type GetType() const override; - void Transform(const CFX_Matrix& matrix) override; - bool IsImage() const override; - CPDF_ImageObject* AsImage() override; - const CPDF_ImageObject* AsImage() const override; - - void CalcBoundingBox(); - CPDF_Image* GetImage() const { return m_pImage; } - void SetOwnedImage(std::unique_ptr pImage); - void SetUnownedImage(CPDF_Image* pImage); - - CFX_Matrix m_Matrix; - - private: - void Release(); - - CPDF_Image* m_pImage; - bool m_pImageOwned; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_IMAGEOBJECT_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_page.h b/core/fpdfapi/fpdf_page/include/cpdf_page.h deleted file mode 100644 index 5be82d5451..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_page.h +++ /dev/null @@ -1,69 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ - -#include - -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" -#include "core/fxcrt/include/fx_basic.h" -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_system.h" - -class CPDF_Dictionary; -class CPDF_Document; -class CPDF_Object; -class CPDF_PageRenderCache; -class CPDF_PageRenderContext; - -class CPDF_Page : public CPDF_PageObjectHolder { - public: - class View {}; // Caller implements as desired, empty here due to layering. - - CPDF_Page(CPDF_Document* pDocument, - CPDF_Dictionary* pPageDict, - bool bPageCache); - ~CPDF_Page() override; - - void ParseContent(); - - void GetDisplayMatrix(CFX_Matrix& matrix, - int xPos, - int yPos, - int xSize, - int ySize, - int iRotate) const; - - FX_FLOAT GetPageWidth() const { return m_PageWidth; } - FX_FLOAT GetPageHeight() const { return m_PageHeight; } - CFX_FloatRect GetPageBBox() const { return m_BBox; } - const CFX_Matrix& GetPageMatrix() const { return m_PageMatrix; } - CPDF_Object* GetPageAttr(const CFX_ByteString& name) const; - CPDF_PageRenderCache* GetRenderCache() const { return m_pPageRender.get(); } - - CPDF_PageRenderContext* GetRenderContext() const { - return m_pRenderContext.get(); - } - void SetRenderContext(std::unique_ptr pContext); - - View* GetView() const { return m_pView; } - void SetView(View* pView) { m_pView = pView; } - - protected: - friend class CPDF_ContentParser; - - void StartParse(); - - FX_FLOAT m_PageWidth; - FX_FLOAT m_PageHeight; - CFX_Matrix m_PageMatrix; - View* m_pView; - std::unique_ptr m_pPageRender; - std::unique_ptr m_pRenderContext; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_pageobject.h b/core/fpdfapi/fpdf_page/include/cpdf_pageobject.h deleted file mode 100644 index d9d584388e..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_pageobject.h +++ /dev/null @@ -1,71 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGEOBJECT_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGEOBJECT_H_ - -#include "core/fpdfapi/fpdf_page/cpdf_contentmark.h" -#include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h" -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_system.h" - -class CPDF_TextObject; -class CPDF_PathObject; -class CPDF_ImageObject; -class CPDF_ShadingObject; -class CPDF_FormObject; - -class CPDF_PageObject : public CPDF_GraphicStates { - public: - enum Type { - TEXT = 1, - PATH, - IMAGE, - SHADING, - FORM, - }; - - CPDF_PageObject(); - ~CPDF_PageObject() override; - - virtual CPDF_PageObject* Clone() const = 0; - virtual Type GetType() const = 0; - virtual void Transform(const CFX_Matrix& matrix) = 0; - virtual bool IsText() const; - virtual bool IsPath() const; - virtual bool IsImage() const; - virtual bool IsShading() const; - virtual bool IsForm() const; - virtual CPDF_TextObject* AsText(); - virtual const CPDF_TextObject* AsText() const; - virtual CPDF_PathObject* AsPath(); - virtual const CPDF_PathObject* AsPath() const; - virtual CPDF_ImageObject* AsImage(); - virtual const CPDF_ImageObject* AsImage() const; - virtual CPDF_ShadingObject* AsShading(); - virtual const CPDF_ShadingObject* AsShading() const; - virtual CPDF_FormObject* AsForm(); - virtual const CPDF_FormObject* AsForm() const; - - void TransformClipPath(CFX_Matrix& matrix); - void TransformGeneralState(CFX_Matrix& matrix); - FX_RECT GetBBox(const CFX_Matrix* pMatrix) const; - - FX_FLOAT m_Left; - FX_FLOAT m_Right; - FX_FLOAT m_Top; - FX_FLOAT m_Bottom; - CPDF_ContentMark m_ContentMark; - - protected: - void CopyData(const CPDF_PageObject* pSrcObject); - - private: - CPDF_PageObject(const CPDF_PageObject& src) = delete; - void operator=(const CPDF_PageObject& src) = delete; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGEOBJECT_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h b/core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h deleted file mode 100644 index e75604858a..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h +++ /dev/null @@ -1,68 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGEOBJECTHOLDER_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGEOBJECTHOLDER_H_ - -#include "core/fpdfapi/fpdf_page/cpdf_pageobjectlist.h" -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_system.h" - -class IFX_Pause; -class CPDF_Dictionary; -class CPDF_Stream; -class CPDF_Document; -class CPDF_ContentParser; - -#define PDFTRANS_GROUP 0x0100 -#define PDFTRANS_ISOLATED 0x0200 -#define PDFTRANS_KNOCKOUT 0x0400 - -class CPDF_PageObjectHolder { - public: - CPDF_PageObjectHolder(); - virtual ~CPDF_PageObjectHolder(); - - void ContinueParse(IFX_Pause* pPause); - bool IsParsed() const { return m_ParseState == CONTENT_PARSED; } - - CPDF_PageObjectList* GetPageObjectList() { return &m_PageObjectList; } - const CPDF_PageObjectList* GetPageObjectList() const { - return &m_PageObjectList; - } - - FX_BOOL BackgroundAlphaNeeded() const { return m_bBackgroundAlphaNeeded; } - void SetBackgroundAlphaNeeded(FX_BOOL needed) { - m_bBackgroundAlphaNeeded = needed; - } - - FX_BOOL HasImageMask() const { return m_bHasImageMask; } - void SetHasImageMask(FX_BOOL value) { m_bHasImageMask = value; } - - void Transform(const CFX_Matrix& matrix); - CFX_FloatRect CalcBoundingBox() const; - - CPDF_Dictionary* m_pFormDict; - CPDF_Stream* m_pFormStream; - CPDF_Document* m_pDocument; - CPDF_Dictionary* m_pPageResources; - CPDF_Dictionary* m_pResources; - CFX_FloatRect m_BBox; - int m_Transparency; - - protected: - enum ParseState { CONTENT_NOT_PARSED, CONTENT_PARSING, CONTENT_PARSED }; - - void LoadTransInfo(); - - FX_BOOL m_bBackgroundAlphaNeeded; - FX_BOOL m_bHasImageMask; - ParseState m_ParseState; - std::unique_ptr m_pParser; - CPDF_PageObjectList m_PageObjectList; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGEOBJECTHOLDER_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_path.h b/core/fpdfapi/fpdf_page/include/cpdf_path.h deleted file mode 100644 index ae98531214..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_path.h +++ /dev/null @@ -1,50 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATH_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATH_H_ - -#include "core/fxcrt/include/cfx_count_ref.h" -#include "core/fxcrt/include/fx_system.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" - -class CPDF_Path { - public: - CPDF_Path(); - CPDF_Path(const CPDF_Path& that); - ~CPDF_Path(); - - void Emplace() { m_Ref.Emplace(); } - explicit operator bool() const { return !!m_Ref; } - - int GetPointCount() const; - void SetPointCount(int count); - const FX_PATHPOINT* GetPoints() const; - FX_PATHPOINT* GetMutablePoints(); - - int GetFlag(int index) const; - FX_FLOAT GetPointX(int index) const; - FX_FLOAT GetPointY(int index) const; - CFX_FloatRect GetBoundingBox() const; - CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const; - - FX_BOOL IsRect() const; - void Transform(const CFX_Matrix* pMatrix); - - void Append(const CPDF_Path& other, const CFX_Matrix* pMatrix); - void Append(const CFX_PathData* pData, const CFX_Matrix* pMatrix); - void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top); - - // TODO(tsepez): Remove when all access thru this class. - const CFX_PathData* GetObject() const { return m_Ref.GetObject(); } - - private: - CFX_CountRef m_Ref; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATH_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_pathobject.h b/core/fpdfapi/fpdf_page/include/cpdf_pathobject.h deleted file mode 100644 index 10d101222a..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_pathobject.h +++ /dev/null @@ -1,36 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATHOBJECT_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATHOBJECT_H_ - -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_path.h" -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_system.h" - -class CPDF_PathObject : public CPDF_PageObject { - public: - CPDF_PathObject(); - ~CPDF_PathObject() override; - - // CPDF_PageObject - CPDF_PathObject* Clone() const override; - Type GetType() const override; - void Transform(const CFX_Matrix& maxtrix) override; - bool IsPath() const override; - CPDF_PathObject* AsPath() override; - const CPDF_PathObject* AsPath() const override; - - void CalcBoundingBox(); - - CPDF_Path m_Path; - int m_FillType; - FX_BOOL m_bStroke; - CFX_Matrix m_Matrix; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATHOBJECT_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_shadingobject.h b/core/fpdfapi/fpdf_page/include/cpdf_shadingobject.h deleted file mode 100644 index 0607bcb42c..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_shadingobject.h +++ /dev/null @@ -1,34 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_SHADINGOBJECT_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_SHADINGOBJECT_H_ - -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fxcrt/include/fx_coordinates.h" - -class CPDF_ShadingPattern; - -class CPDF_ShadingObject : public CPDF_PageObject { - public: - CPDF_ShadingObject(); - ~CPDF_ShadingObject() override; - - // CPDF_PageObject - CPDF_ShadingObject* Clone() const override; - Type GetType() const override; - void Transform(const CFX_Matrix& matrix) override; - bool IsShading() const override; - CPDF_ShadingObject* AsShading() override; - const CPDF_ShadingObject* AsShading() const override; - - void CalcBoundingBox(); - - CPDF_ShadingPattern* m_pShading; - CFX_Matrix m_Matrix; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_SHADINGOBJECT_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_textobject.h b/core/fpdfapi/fpdf_page/include/cpdf_textobject.h deleted file mode 100644 index 9438811006..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_textobject.h +++ /dev/null @@ -1,69 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_TEXTOBJECT_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_TEXTOBJECT_H_ - -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fxcrt/include/fx_string.h" -#include "core/fxcrt/include/fx_system.h" - -struct CPDF_TextObjectItem { - uint32_t m_CharCode; - FX_FLOAT m_OriginX; - FX_FLOAT m_OriginY; -}; - -class CPDF_TextObject : public CPDF_PageObject { - public: - CPDF_TextObject(); - ~CPDF_TextObject() override; - - // CPDF_PageObject - CPDF_TextObject* Clone() const override; - Type GetType() const override; - void Transform(const CFX_Matrix& matrix) override; - bool IsText() const override; - CPDF_TextObject* AsText() override; - const CPDF_TextObject* AsText() const override; - - int CountItems() const; - void GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const; - int CountChars() const; - void GetCharInfo(int index, uint32_t& charcode, FX_FLOAT& kerning) const; - void GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const; - FX_FLOAT GetCharWidth(uint32_t charcode) const; - FX_FLOAT GetPosX() const; - FX_FLOAT GetPosY() const; - void GetTextMatrix(CFX_Matrix* pMatrix) const; - CPDF_Font* GetFont() const; - FX_FLOAT GetFontSize() const; - - void SetText(const CFX_ByteString& text); - void SetPosition(FX_FLOAT x, FX_FLOAT y); - - void RecalcPositionData(); - - protected: - friend class CPDF_RenderStatus; - friend class CPDF_StreamContentParser; - friend class CPDF_TextRenderer; - - void SetSegments(const CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs); - - void CalcPositionData(FX_FLOAT* pTextAdvanceX, - FX_FLOAT* pTextAdvanceY, - FX_FLOAT horz_scale, - int level = 0); - - FX_FLOAT m_PosX; - FX_FLOAT m_PosY; - int m_nChars; - uint32_t* m_pCharCodes; - FX_FLOAT* m_pCharPos; -}; - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_TEXTOBJECT_H_ diff --git a/core/fpdfapi/fpdf_page/include/cpdf_textstate.h b/core/fpdfapi/fpdf_page/include/cpdf_textstate.h deleted file mode 100644 index b457026bc8..0000000000 --- a/core/fpdfapi/fpdf_page/include/cpdf_textstate.h +++ /dev/null @@ -1,91 +0,0 @@ -// 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 CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_TEXTSTATE_H_ -#define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_TEXTSTATE_H_ - -#include "core/fxcrt/include/cfx_count_ref.h" -#include "core/fxcrt/include/fx_basic.h" - -class CPDF_Document; -class CPDF_Font; - -// See PDF Reference 1.7, page 402, table 5.3. -enum class TextRenderingMode { - MODE_FILL = 0, - MODE_STROKE = 1, - MODE_FILL_STROKE = 2, - MODE_INVISIBLE = 3, - MODE_FILL_CLIP = 4, - MODE_STROKE_CLIP = 5, - MODE_FILL_STROKE_CLIP = 6, - MODE_CLIP = 7, -}; - -class CPDF_TextState { - public: - CPDF_TextState(); - ~CPDF_TextState(); - - void Emplace(); - - CPDF_Font* GetFont() const; - void SetFont(CPDF_Font* pFont); - - FX_FLOAT GetFontSize() const; - void SetFontSize(FX_FLOAT size); - - const FX_FLOAT* GetMatrix() const; - FX_FLOAT* GetMutableMatrix(); - - FX_FLOAT GetCharSpace() const; - void SetCharSpace(FX_FLOAT sp); - - FX_FLOAT GetWordSpace() const; - void SetWordSpace(FX_FLOAT sp); - - FX_FLOAT GetFontSizeV() const; - FX_FLOAT GetFontSizeH() const; - FX_FLOAT GetBaselineAngle() const; - FX_FLOAT GetShearAngle() const; - - TextRenderingMode GetTextMode() const; - void SetTextMode(TextRenderingMode mode); - - const FX_FLOAT* GetCTM() const; - FX_FLOAT* GetMutableCTM(); - - private: - class TextData { - public: - TextData(); - TextData(const TextData& src); - ~TextData(); - - void SetFont(CPDF_Font* pFont); - FX_FLOAT GetFontSizeV() const; - FX_FLOAT GetFontSizeH() const; - FX_FLOAT GetBaselineAngle() const; - FX_FLOAT GetShearAngle() const; - - CPDF_Font* m_pFont; - CPDF_Document* m_pDocument; - FX_FLOAT m_FontSize; - FX_FLOAT m_CharSpace; - FX_FLOAT m_WordSpace; - TextRenderingMode m_TextMode; - FX_FLOAT m_Matrix[4]; - FX_FLOAT m_CTM[4]; - }; - - CFX_CountRef m_Ref; -}; - -bool SetTextRenderingModeFromInt(int iMode, TextRenderingMode* mode); -bool TextRenderingModeIsClipMode(const TextRenderingMode& mode); -bool TextRenderingModeIsStrokeMode(const TextRenderingMode& mode); - -#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_TEXTSTATE_H_ diff --git a/core/fpdfapi/fpdf_page/pageint.h b/core/fpdfapi/fpdf_page/pageint.h index c5b80aa550..0a99cc1f0a 100644 --- a/core/fpdfapi/fpdf_page/pageint.h +++ b/core/fpdfapi/fpdf_page/pageint.h @@ -15,7 +15,7 @@ #include "core/fpdfapi/fpdf_page/cpdf_contentmark.h" #include "core/fpdfapi/fpdf_page/cpdf_countedobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h" #include "core/fxcrt/include/cfx_string_pool_template.h" #include "core/fxcrt/include/cfx_weak_ptr.h" #include "core/fxge/include/cfx_pathdata.h" diff --git a/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp b/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp index 0b415d370d..024adc9c9c 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp @@ -16,8 +16,8 @@ #include "core/fpdfapi/fpdf_parser/include/cpdf_reference.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_string.h" -#include "third_party/base/stl_util.h" #include "third_party/base/logging.h" +#include "third_party/base/stl_util.h" CPDF_Dictionary::CPDF_Dictionary(const CFX_WeakPtr& pPool) : m_pPool(pPool) {} diff --git a/core/fpdfapi/fpdf_render/fpdf_render.cpp b/core/fpdfapi/fpdf_render/fpdf_render.cpp index 8043f932bb..355c79612b 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render.cpp @@ -10,15 +10,15 @@ #include "core/fpdfapi/fpdf_font/cpdf_type3char.h" #include "core/fpdfapi/fpdf_font/cpdf_type3font.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_formobject.h" #include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_formobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_image.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_image.h" +#include "core/fpdfapi/fpdf_page/cpdf_imageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pathobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_textobject.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" diff --git a/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp index 332f0016ac..fd5d7ff698 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp @@ -6,7 +6,7 @@ #include "core/fpdfapi/fpdf_render/cpdf_pagerendercache.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h" diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp index 7414f0a5de..b70f009fd2 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -10,12 +10,12 @@ #include #include +#include "core/fpdfapi/fpdf_page/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_image.h" +#include "core/fpdfapi/fpdf_page/cpdf_imageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h" #include "core/fpdfapi/fpdf_page/cpdf_tilingpattern.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_image.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" diff --git a/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index 20eaba7e63..ede1d3a401 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -10,8 +10,8 @@ #include #include -#include "core/fpdfapi/fpdf_page/include/cpdf_image.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_image.h" +#include "core/fpdfapi/fpdf_page/cpdf_imageobject.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" diff --git a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp index e20138c8e0..eb264675df 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp @@ -8,14 +8,14 @@ #include +#include "core/fpdfapi/fpdf_page/cpdf_form.h" #include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h" #include "core/fpdfapi/fpdf_page/cpdf_meshstream.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pathobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_shadingobject.h" #include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h" #include "core/fpdfapi/fpdf_page/cpdf_tilingpattern.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_shadingobject.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp index 6a6d667086..af2b73c89e 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp @@ -12,11 +12,11 @@ #include "core/fpdfapi/fpdf_font/cpdf_font.h" #include "core/fpdfapi/fpdf_font/cpdf_type3char.h" #include "core/fpdfapi/fpdf_font/cpdf_type3font.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_imageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pathobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_textobject.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" diff --git a/core/fpdfapi/fpdf_render/render_int.h b/core/fpdfapi/fpdf_render/render_int.h index afd9c83b44..aa2baa2e26 100644 --- a/core/fpdfapi/fpdf_render/render_int.h +++ b/core/fpdfapi/fpdf_render/render_int.h @@ -11,9 +11,9 @@ #include #include +#include "core/fpdfapi/fpdf_page/cpdf_clippath.h" #include "core/fpdfapi/fpdf_page/cpdf_countedobject.h" #include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_clippath.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h" #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" #include "core/fxge/include/cfx_fxgedevice.h" diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp index 2cc767a066..f88f4fdc01 100644 --- a/core/fpdfdoc/cpdf_annot.cpp +++ b/core/fpdfdoc/cpdf_annot.cpp @@ -6,8 +6,8 @@ #include "core/fpdfdoc/include/cpdf_annot.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h" diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp index 38d73460ef..f27007ac31 100644 --- a/core/fpdfdoc/cpdf_annotlist.cpp +++ b/core/fpdfdoc/cpdf_annotlist.cpp @@ -6,7 +6,7 @@ #include "core/fpdfdoc/include/cpdf_annotlist.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_reference.h" #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp index c633d0c187..ec71a2f163 100644 --- a/core/fpdfdoc/cpdf_formcontrol.cpp +++ b/core/fpdfdoc/cpdf_formcontrol.cpp @@ -8,7 +8,7 @@ #include -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index b5d78bad54..05c3452af0 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -8,7 +8,7 @@ #include "core/fpdfapi/fpdf_font/cpdf_font.h" #include "core/fpdfapi/fpdf_font/cpdf_fontencoding.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cfdf_document.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" diff --git a/core/fpdfdoc/cpdf_linklist.cpp b/core/fpdfdoc/cpdf_linklist.cpp index d9a10ef3e2..d28571cd88 100644 --- a/core/fpdfdoc/cpdf_linklist.cpp +++ b/core/fpdfdoc/cpdf_linklist.cpp @@ -6,7 +6,7 @@ #include "core/fpdfdoc/include/cpdf_linklist.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" CPDF_LinkList::CPDF_LinkList() {} diff --git a/core/fpdfdoc/cpdf_occontext.cpp b/core/fpdfdoc/cpdf_occontext.cpp index b04c2bdcbb..03edab9294 100644 --- a/core/fpdfdoc/cpdf_occontext.cpp +++ b/core/fpdfdoc/cpdf_occontext.cpp @@ -6,7 +6,7 @@ #include "core/fpdfdoc/include/cpdf_occontext.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp index f064c90545..6c9857ccc1 100644 --- a/core/fpdftext/cpdf_textpage.cpp +++ b/core/fpdftext/cpdf_textpage.cpp @@ -11,11 +11,11 @@ #include #include "core/fpdfapi/fpdf_font/cpdf_font.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_formobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_formobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_textobject.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_string.h" #include "core/fpdftext/unicodenormalizationdata.h" diff --git a/core/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/fxcodec/codec/fx_codec_jpx_opj.cpp index e64fa471cd..d5a95eef89 100644 --- a/core/fxcodec/codec/fx_codec_jpx_opj.cpp +++ b/core/fxcodec/codec/fx_codec_jpx_opj.cpp @@ -8,7 +8,7 @@ #include #include -#include "core/fpdfapi/fpdf_page/include/cpdf_colorspace.h" +#include "core/fpdfapi/fpdf_page/cpdf_colorspace.h" #include "core/fxcodec/codec/codec_int.h" #include "core/fxcodec/include/fx_codec.h" #include "core/fxcrt/include/fx_safe_types.h" diff --git a/fpdfsdk/DEPS b/fpdfsdk/DEPS index 04ade247c3..a8dd860bbd 100644 --- a/fpdfsdk/DEPS +++ b/fpdfsdk/DEPS @@ -2,7 +2,7 @@ include_rules = [ '+core/fpdftext/include', '+core/fpdfapi/include', '+core/fpdfapi/fpdf_edit', - '+core/fpdfapi/fpdf_page/include', + '+core/fpdfapi/fpdf_page', '+core/fpdfapi/fpdf_parser/include', '+core/fpdfapi/fpdf_render/include', '+core/fpdfdoc/include', diff --git a/fpdfsdk/cba_annotiterator.cpp b/fpdfsdk/cba_annotiterator.cpp index feca9fc55b..4b4a38de30 100644 --- a/fpdfsdk/cba_annotiterator.cpp +++ b/fpdfsdk/cba_annotiterator.cpp @@ -6,7 +6,7 @@ #include "fpdfsdk/include/cba_annotiterator.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "fpdfsdk/include/cpdfsdk_annot.h" #include "fpdfsdk/include/cpdfsdk_pageview.h" diff --git a/fpdfsdk/cpdfsdk_baannothandler.cpp b/fpdfsdk/cpdfsdk_baannothandler.cpp index 8131d6f19b..d4a5d3d948 100644 --- a/fpdfsdk/cpdfsdk_baannothandler.cpp +++ b/fpdfsdk/cpdfsdk_baannothandler.cpp @@ -9,7 +9,7 @@ #include #include -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfdoc/include/cpdf_interform.h" #include "fpdfsdk/formfiller/cffl_formfiller.h" diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp index 01889d5947..378f8eb9b2 100644 --- a/fpdfsdk/cpdfsdk_interform.cpp +++ b/fpdfsdk/cpdfsdk_interform.cpp @@ -10,7 +10,7 @@ #include #include -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cfdf_document.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp index e4e093f818..287a40d709 100644 --- a/fpdfsdk/cpdfsdk_widgethandler.cpp +++ b/fpdfsdk/cpdfsdk_widgethandler.cpp @@ -9,7 +9,7 @@ #include #include -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfdoc/include/cpdf_interform.h" #include "fpdfsdk/formfiller/cffl_formfiller.h" diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp index 311b48f596..129c1dfbab 100644 --- a/fpdfsdk/formfiller/cba_fontmap.cpp +++ b/fpdfsdk/formfiller/cba_fontmap.cpp @@ -7,7 +7,7 @@ #include "fpdfsdk/formfiller/cba_fontmap.h" #include "core/fpdfapi/fpdf_font/cpdf_font.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp index 827b9b09ca..64a76366f9 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.cpp +++ b/fpdfsdk/formfiller/cffl_formfiller.cpp @@ -6,7 +6,7 @@ #include "fpdfsdk/formfiller/cffl_formfiller.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fxge/include/cfx_renderdevice.h" #include "fpdfsdk/formfiller/cba_fontmap.h" #include "fpdfsdk/include/cpdfsdk_document.h" diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp index dbe31f7857..65c7e00294 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp @@ -6,7 +6,7 @@ #include "fpdfsdk/formfiller/cffl_interactiveformfiller.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fxge/include/cfx_graphstatedata.h" #include "core/fxge/include/cfx_pathdata.h" diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp index 4907173f22..0418dfc46c 100644 --- a/fpdfsdk/fpdf_flatten.cpp +++ b/fpdfsdk/fpdf_flatten.cpp @@ -8,8 +8,8 @@ #include -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_number.h" diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp index 4ebeff646d..45a5ee3f8e 100644 --- a/fpdfsdk/fpdf_progressive.cpp +++ b/fpdfsdk/fpdf_progressive.cpp @@ -6,7 +6,7 @@ #include "public/fpdf_progressive.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h" #include "core/fpdfapi/include/cpdf_pagerendercontext.h" #include "core/fxcrt/include/fx_memory.h" diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp index 8841c96f23..a82cc8bc86 100644 --- a/fpdfsdk/fpdf_transformpage.cpp +++ b/fpdfsdk/fpdf_transformpage.cpp @@ -6,10 +6,10 @@ #include "public/fpdf_transformpage.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_clippath.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_path.h" +#include "core/fpdfapi/fpdf_page/cpdf_clippath.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_path.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_number.h" diff --git a/fpdfsdk/fpdfdoc.cpp b/fpdfsdk/fpdfdoc.cpp index f22f73743e..8e2d45998c 100644 --- a/fpdfsdk/fpdfdoc.cpp +++ b/fpdfsdk/fpdfdoc.cpp @@ -8,7 +8,7 @@ #include -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfdoc/include/cpdf_bookmark.h" diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdfeditimg.cpp index d64626711a..2c10dd9d58 100644 --- a/fpdfsdk/fpdfeditimg.cpp +++ b/fpdfsdk/fpdfeditimg.cpp @@ -6,9 +6,9 @@ #include "public/fpdf_edit.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_image.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_image.h" +#include "core/fpdfapi/fpdf_page/cpdf_imageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" #include "core/fpdfapi/include/cpdf_modulemgr.h" #include "fpdfsdk/include/fsdk_define.h" diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp index 5358a69cd2..9c8b56c81d 100644 --- a/fpdfsdk/fpdfeditpage.cpp +++ b/fpdfsdk/fpdfeditpage.cpp @@ -11,13 +11,13 @@ #include #include "core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_form.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_formobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_shadingobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_form.h" +#include "core/fpdfapi/fpdf_page/cpdf_formobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_imageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pathobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_shadingobject.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_number.h" diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp index 9baabc4de4..ceeb2a0298 100644 --- a/fpdfsdk/fpdfformfill.cpp +++ b/fpdfsdk/fpdfformfill.cpp @@ -9,7 +9,7 @@ #include #include -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" #include "core/fpdfdoc/include/cpdf_formcontrol.h" diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdftext.cpp index 104d307070..7662b7d7cb 100644 --- a/fpdfsdk/fpdftext.cpp +++ b/fpdfsdk/fpdftext.cpp @@ -6,7 +6,7 @@ #include "public/fpdf_text.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfdoc/include/cpdf_viewerpreferences.h" #include "core/fpdftext/include/cpdf_linkextract.h" #include "core/fpdftext/include/cpdf_textpage.h" diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 3c60ab0041..34f8cdd43a 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -9,7 +9,7 @@ #include #include -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp index a44172e191..10a2e6f1a9 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp @@ -7,8 +7,8 @@ #include "fpdfsdk/fpdfxfa/include/cpdfxfa_docenvironment.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" -#include "core/fpdfapi/fpdf_parser/include/cpdf_string.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h" +#include "core/fpdfapi/fpdf_parser/include/cpdf_string.h" #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" #include "fpdfsdk/fpdfxfa/include/fpdfxfa_page.h" #include "fpdfsdk/include/cpdfsdk_document.h" diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_page.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_page.cpp index 3567524c65..0115cbc4e7 100644 --- a/fpdfsdk/fpdfxfa/fpdfxfa_page.cpp +++ b/fpdfsdk/fpdfxfa/fpdfxfa_page.cpp @@ -6,7 +6,7 @@ #include "fpdfsdk/fpdfxfa/include/fpdfxfa_page.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" #include "fpdfsdk/fpdfxfa/include/fpdfxfa_util.h" diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp index 202b5dc000..7cb5fec18d 100644 --- a/fpdfsdk/fxedit/fxet_edit.cpp +++ b/fpdfsdk/fxedit/fxet_edit.cpp @@ -11,10 +11,10 @@ #include #include "core/fpdfapi/fpdf_font/cpdf_font.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h" +#include "core/fpdfapi/fpdf_page/cpdf_pathobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_textobject.h" #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" #include "core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h" diff --git a/fpdfsdk/include/cpdfsdk_environment.h b/fpdfsdk/include/cpdfsdk_environment.h index b694359320..2b879bbe79 100644 --- a/fpdfsdk/include/cpdfsdk_environment.h +++ b/fpdfsdk/include/cpdfsdk_environment.h @@ -9,7 +9,7 @@ #include -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfdoc/include/cpdf_occontext.h" #include "core/fxcrt/include/cfx_observable.h" diff --git a/fpdfsdk/include/cpdfsdk_pageview.h b/fpdfsdk/include/cpdfsdk_pageview.h index 2a54dffc30..0bcce28feb 100644 --- a/fpdfsdk/include/cpdfsdk_pageview.h +++ b/fpdfsdk/include/cpdfsdk_pageview.h @@ -10,7 +10,7 @@ #include #include -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fxcrt/include/fx_system.h" #include "fpdfsdk/include/cpdfsdk_annot.h" #include "fpdfsdk/include/cpdfsdk_document.h" diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp index cf68df1f4c..eb141232b1 100644 --- a/fpdfsdk/javascript/Document.cpp +++ b/fpdfsdk/javascript/Document.cpp @@ -10,7 +10,7 @@ #include #include "core/fpdfapi/fpdf_font/cpdf_font.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" diff --git a/fpdfsdk/javascript/Document.h b/fpdfsdk/javascript/Document.h index 544a042eec..609d7c506c 100644 --- a/fpdfsdk/javascript/Document.h +++ b/fpdfsdk/javascript/Document.h @@ -11,8 +11,8 @@ #include #include -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" +#include "core/fpdfapi/fpdf_page/cpdf_textobject.h" #include "fpdfsdk/include/cpdfsdk_document.h" #include "fpdfsdk/javascript/JS_Define.h" diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp index 21ebf27cd5..29a4aeb012 100644 --- a/fpdfsdk/javascript/Field.cpp +++ b/fpdfsdk/javascript/Field.cpp @@ -12,7 +12,7 @@ #include #include "core/fpdfapi/fpdf_font/cpdf_font.h" -#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" +#include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfdoc/include/cpdf_interform.h" #include "fpdfsdk/include/cpdfsdk_document.h" diff --git a/xfa/fxfa/app/DEPS b/xfa/fxfa/app/DEPS index 3c47627df8..2a7e28d120 100644 --- a/xfa/fxfa/app/DEPS +++ b/xfa/fxfa/app/DEPS @@ -1,7 +1,7 @@ include_rules = [ '+core/fdrm/crypto', '+core/fpdfapi/fpdf_font', - '+core/fpdfapi/fpdf_page/include', + '+core/fpdfapi/fpdf_page', '+core/fpdfapi/fpdf_parser/include', '+core/fpdfdoc/include', '+core/fxcodec/include', diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp index d71783b275..2ef9840c1a 100644 --- a/xfa/fxfa/app/xfa_ffwidget.cpp +++ b/xfa/fxfa/app/xfa_ffwidget.cpp @@ -9,7 +9,7 @@ #include #include -#include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" +#include "core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h" #include "core/fxcodec/codec/include/ccodec_progressivedecoder.h" #include "core/fxcodec/include/fx_codec.h" #include "core/fxge/include/cfx_gemodule.h" -- cgit v1.2.3