From 1727aee85f22d9403e6cd8a0f786b9b7c0a2740a Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 29 Sep 2016 13:12:56 -0700 Subject: Move core/fpdfdoc/include to core/fpdfdoc BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2374383003 --- BUILD.gn | 64 +++---- core/fpdfapi/cpdf_pagerendercontext.cpp | 4 +- core/fpdfapi/fpdf_parser/cpdf_document.h | 2 +- core/fpdfapi/fpdf_render/fpdf_render.cpp | 2 +- core/fpdfapi/fpdf_render/fpdf_render_image.cpp | 2 +- core/fpdfdoc/cline.h | 2 +- core/fpdfdoc/cpdf_aaction.cpp | 2 +- core/fpdfdoc/cpdf_aaction.h | 51 +++++ core/fpdfdoc/cpdf_action.cpp | 6 +- core/fpdfdoc/cpdf_action.h | 59 ++++++ core/fpdfdoc/cpdf_actionfields.cpp | 4 +- core/fpdfdoc/cpdf_actionfields.h | 29 +++ core/fpdfdoc/cpdf_annot.cpp | 2 +- core/fpdfdoc/cpdf_annot.h | 131 +++++++++++++ core/fpdfdoc/cpdf_annotlist.cpp | 8 +- core/fpdfdoc/cpdf_annotlist.h | 64 +++++++ core/fpdfdoc/cpdf_apsettings.cpp | 2 +- core/fpdfdoc/cpdf_apsettings.h | 2 +- core/fpdfdoc/cpdf_bookmark.cpp | 4 +- core/fpdfdoc/cpdf_bookmark.h | 33 ++++ core/fpdfdoc/cpdf_bookmarktree.cpp | 2 +- core/fpdfdoc/cpdf_bookmarktree.h | 26 +++ core/fpdfdoc/cpdf_defaultappearance.cpp | 4 +- core/fpdfdoc/cpdf_defaultappearance.h | 52 ++++++ core/fpdfdoc/cpdf_dest.cpp | 2 +- core/fpdfdoc/cpdf_dest.h | 32 ++++ core/fpdfdoc/cpdf_docjsactions.cpp | 4 +- core/fpdfdoc/cpdf_docjsactions.h | 29 +++ core/fpdfdoc/cpdf_filespec.cpp | 2 +- core/fpdfdoc/cpdf_filespec.h | 37 ++++ core/fpdfdoc/cpdf_filespec_unittest.cpp | 2 +- core/fpdfdoc/cpdf_formcontrol.cpp | 4 +- core/fpdfdoc/cpdf_formcontrol.h | 134 ++++++++++++++ core/fpdfdoc/cpdf_formfield.cpp | 6 +- core/fpdfdoc/cpdf_formfield.h | 168 +++++++++++++++++ core/fpdfdoc/cpdf_formfield_unittest.cpp | 2 +- core/fpdfdoc/cpdf_iconfit.cpp | 2 +- core/fpdfdoc/cpdf_iconfit.h | 30 +++ core/fpdfdoc/cpdf_interform.cpp | 6 +- core/fpdfdoc/cpdf_interform.h | 119 ++++++++++++ core/fpdfdoc/cpdf_link.cpp | 4 +- core/fpdfdoc/cpdf_link.h | 31 ++++ core/fpdfdoc/cpdf_linklist.cpp | 2 +- core/fpdfdoc/cpdf_linklist.h | 36 ++++ core/fpdfdoc/cpdf_metadata.cpp | 2 +- core/fpdfdoc/cpdf_metadata.h | 26 +++ core/fpdfdoc/cpdf_nametree.cpp | 2 +- core/fpdfdoc/cpdf_nametree.h | 34 ++++ core/fpdfdoc/cpdf_occontext.cpp | 2 +- core/fpdfdoc/cpdf_occontext.h | 42 +++++ core/fpdfdoc/cpdf_variabletext.cpp | 8 +- core/fpdfdoc/cpdf_variabletext.h | 245 +++++++++++++++++++++++++ core/fpdfdoc/cpdf_viewerpreferences.cpp | 2 +- core/fpdfdoc/cpdf_viewerpreferences.h | 34 ++++ core/fpdfdoc/cpvt_fontmap.cpp | 2 +- core/fpdfdoc/cpvt_fontmap.h | 2 +- core/fpdfdoc/cpvt_generateap.cpp | 6 +- core/fpdfdoc/cpvt_generateap.h | 4 +- core/fpdfdoc/cpvt_line.h | 25 +++ core/fpdfdoc/cpvt_secprops.h | 30 +++ core/fpdfdoc/cpvt_section.h | 22 +++ core/fpdfdoc/cpvt_sectioninfo.h | 4 +- core/fpdfdoc/cpvt_word.h | 38 ++++ core/fpdfdoc/cpvt_wordinfo.h | 2 +- core/fpdfdoc/cpvt_wordplace.h | 73 ++++++++ core/fpdfdoc/cpvt_wordprops.h | 58 ++++++ core/fpdfdoc/cpvt_wordrange.h | 59 ++++++ core/fpdfdoc/doc_tagged.cpp | 2 +- core/fpdfdoc/fpdf_tagged.h | 93 ++++++++++ core/fpdfdoc/include/cpdf_aaction.h | 51 ----- core/fpdfdoc/include/cpdf_action.h | 59 ------ core/fpdfdoc/include/cpdf_actionfields.h | 29 --- core/fpdfdoc/include/cpdf_annot.h | 131 ------------- core/fpdfdoc/include/cpdf_annotlist.h | 64 ------- core/fpdfdoc/include/cpdf_bookmark.h | 33 ---- core/fpdfdoc/include/cpdf_bookmarktree.h | 26 --- core/fpdfdoc/include/cpdf_defaultappearance.h | 52 ------ core/fpdfdoc/include/cpdf_dest.h | 32 ---- core/fpdfdoc/include/cpdf_docjsactions.h | 29 --- core/fpdfdoc/include/cpdf_filespec.h | 37 ---- core/fpdfdoc/include/cpdf_formcontrol.h | 134 -------------- core/fpdfdoc/include/cpdf_formfield.h | 168 ----------------- core/fpdfdoc/include/cpdf_iconfit.h | 30 --- core/fpdfdoc/include/cpdf_interform.h | 119 ------------ core/fpdfdoc/include/cpdf_link.h | 31 ---- core/fpdfdoc/include/cpdf_linklist.h | 36 ---- core/fpdfdoc/include/cpdf_metadata.h | 26 --- core/fpdfdoc/include/cpdf_nametree.h | 34 ---- core/fpdfdoc/include/cpdf_occontext.h | 42 ----- core/fpdfdoc/include/cpdf_variabletext.h | 245 ------------------------- core/fpdfdoc/include/cpdf_viewerpreferences.h | 34 ---- core/fpdfdoc/include/cpvt_line.h | 25 --- core/fpdfdoc/include/cpvt_secprops.h | 30 --- core/fpdfdoc/include/cpvt_section.h | 22 --- core/fpdfdoc/include/cpvt_word.h | 38 ---- core/fpdfdoc/include/cpvt_wordplace.h | 73 -------- core/fpdfdoc/include/cpvt_wordprops.h | 58 ------ core/fpdfdoc/include/cpvt_wordrange.h | 59 ------ core/fpdfdoc/include/fpdf_tagged.h | 93 ---------- core/fpdfdoc/include/ipdf_formnotify.h | 32 ---- core/fpdfdoc/include/ipvt_fontmap.h | 29 --- core/fpdfdoc/ipdf_formnotify.h | 32 ++++ core/fpdfdoc/ipvt_fontmap.h | 29 +++ core/fpdfdoc/tagged_int.h | 2 +- fpdfsdk/DEPS | 2 +- fpdfsdk/cpdfsdk_annothandlermgr.cpp | 2 +- fpdfsdk/cpdfsdk_baannothandler.cpp | 2 +- fpdfsdk/cpdfsdk_document.cpp | 6 +- fpdfsdk/cpdfsdk_interform.cpp | 4 +- fpdfsdk/cpdfsdk_pageview.cpp | 4 +- fpdfsdk/cpdfsdk_widget.cpp | 10 +- fpdfsdk/cpdfsdk_widgethandler.cpp | 2 +- fpdfsdk/cpdfsdk_xfawidgethandler.cpp | 2 +- fpdfsdk/formfiller/cba_fontmap.cpp | 2 +- fpdfsdk/fpdf_ext.cpp | 6 +- fpdfsdk/fpdf_flatten.cpp | 2 +- fpdfsdk/fpdfdoc.cpp | 4 +- fpdfsdk/fpdfeditpage.cpp | 4 +- fpdfsdk/fpdfformfill.cpp | 8 +- fpdfsdk/fpdftext.cpp | 2 +- fpdfsdk/fpdfview.cpp | 8 +- fpdfsdk/fsdk_actionhandler.cpp | 4 +- fpdfsdk/fxedit/DEPS | 2 +- fpdfsdk/fxedit/fxet_ap.cpp | 4 +- fpdfsdk/fxedit/fxet_edit.cpp | 6 +- fpdfsdk/fxedit/fxet_list.cpp | 2 +- fpdfsdk/fxedit/include/DEPS | 2 +- fpdfsdk/fxedit/include/fxet_edit.h | 4 +- fpdfsdk/include/cba_annotiterator.h | 2 +- fpdfsdk/include/cpdfsdk_annot.h | 6 +- fpdfsdk/include/cpdfsdk_annothandlermgr.h | 2 +- fpdfsdk/include/cpdfsdk_baannot.h | 8 +- fpdfsdk/include/cpdfsdk_environment.h | 2 +- fpdfsdk/include/cpdfsdk_interform.h | 4 +- fpdfsdk/include/cpdfsdk_widget.h | 6 +- fpdfsdk/include/fsdk_actionhandler.h | 4 +- fpdfsdk/javascript/Document.cpp | 4 +- fpdfsdk/javascript/Field.cpp | 2 +- fpdfsdk/javascript/PublicMethods.cpp | 2 +- fpdfsdk/pdfwindow/DEPS | 2 +- fpdfsdk/pdfwindow/PWL_Edit.cpp | 2 +- fpdfsdk/pdfwindow/PWL_EditCtrl.cpp | 4 +- fpdfsdk/pdfwindow/PWL_FontMap.cpp | 2 +- fpdfsdk/pdfwindow/PWL_FontMap.h | 2 +- fpdfsdk/pdfwindow/PWL_Utils.cpp | 2 +- fpdfsdk/pdfwindow/PWL_Utils.h | 2 +- fpdfsdk/pdfwindow/PWL_Wnd.h | 2 +- xfa/fxfa/app/DEPS | 2 +- xfa/fxfa/app/xfa_ffdoc.cpp | 2 +- 149 files changed, 2074 insertions(+), 2074 deletions(-) create mode 100644 core/fpdfdoc/cpdf_aaction.h create mode 100644 core/fpdfdoc/cpdf_action.h create mode 100644 core/fpdfdoc/cpdf_actionfields.h create mode 100644 core/fpdfdoc/cpdf_annot.h create mode 100644 core/fpdfdoc/cpdf_annotlist.h create mode 100644 core/fpdfdoc/cpdf_bookmark.h create mode 100644 core/fpdfdoc/cpdf_bookmarktree.h create mode 100644 core/fpdfdoc/cpdf_defaultappearance.h create mode 100644 core/fpdfdoc/cpdf_dest.h create mode 100644 core/fpdfdoc/cpdf_docjsactions.h create mode 100644 core/fpdfdoc/cpdf_filespec.h create mode 100644 core/fpdfdoc/cpdf_formcontrol.h create mode 100644 core/fpdfdoc/cpdf_formfield.h create mode 100644 core/fpdfdoc/cpdf_iconfit.h create mode 100644 core/fpdfdoc/cpdf_interform.h create mode 100644 core/fpdfdoc/cpdf_link.h create mode 100644 core/fpdfdoc/cpdf_linklist.h create mode 100644 core/fpdfdoc/cpdf_metadata.h create mode 100644 core/fpdfdoc/cpdf_nametree.h create mode 100644 core/fpdfdoc/cpdf_occontext.h create mode 100644 core/fpdfdoc/cpdf_variabletext.h create mode 100644 core/fpdfdoc/cpdf_viewerpreferences.h create mode 100644 core/fpdfdoc/cpvt_line.h create mode 100644 core/fpdfdoc/cpvt_secprops.h create mode 100644 core/fpdfdoc/cpvt_section.h create mode 100644 core/fpdfdoc/cpvt_word.h create mode 100644 core/fpdfdoc/cpvt_wordplace.h create mode 100644 core/fpdfdoc/cpvt_wordprops.h create mode 100644 core/fpdfdoc/cpvt_wordrange.h create mode 100644 core/fpdfdoc/fpdf_tagged.h delete mode 100644 core/fpdfdoc/include/cpdf_aaction.h delete mode 100644 core/fpdfdoc/include/cpdf_action.h delete mode 100644 core/fpdfdoc/include/cpdf_actionfields.h delete mode 100644 core/fpdfdoc/include/cpdf_annot.h delete mode 100644 core/fpdfdoc/include/cpdf_annotlist.h delete mode 100644 core/fpdfdoc/include/cpdf_bookmark.h delete mode 100644 core/fpdfdoc/include/cpdf_bookmarktree.h delete mode 100644 core/fpdfdoc/include/cpdf_defaultappearance.h delete mode 100644 core/fpdfdoc/include/cpdf_dest.h delete mode 100644 core/fpdfdoc/include/cpdf_docjsactions.h delete mode 100644 core/fpdfdoc/include/cpdf_filespec.h delete mode 100644 core/fpdfdoc/include/cpdf_formcontrol.h delete mode 100644 core/fpdfdoc/include/cpdf_formfield.h delete mode 100644 core/fpdfdoc/include/cpdf_iconfit.h delete mode 100644 core/fpdfdoc/include/cpdf_interform.h delete mode 100644 core/fpdfdoc/include/cpdf_link.h delete mode 100644 core/fpdfdoc/include/cpdf_linklist.h delete mode 100644 core/fpdfdoc/include/cpdf_metadata.h delete mode 100644 core/fpdfdoc/include/cpdf_nametree.h delete mode 100644 core/fpdfdoc/include/cpdf_occontext.h delete mode 100644 core/fpdfdoc/include/cpdf_variabletext.h delete mode 100644 core/fpdfdoc/include/cpdf_viewerpreferences.h delete mode 100644 core/fpdfdoc/include/cpvt_line.h delete mode 100644 core/fpdfdoc/include/cpvt_secprops.h delete mode 100644 core/fpdfdoc/include/cpvt_section.h delete mode 100644 core/fpdfdoc/include/cpvt_word.h delete mode 100644 core/fpdfdoc/include/cpvt_wordplace.h delete mode 100644 core/fpdfdoc/include/cpvt_wordprops.h delete mode 100644 core/fpdfdoc/include/cpvt_wordrange.h delete mode 100644 core/fpdfdoc/include/fpdf_tagged.h delete mode 100644 core/fpdfdoc/include/ipdf_formnotify.h delete mode 100644 core/fpdfdoc/include/ipvt_fontmap.h create mode 100644 core/fpdfdoc/ipdf_formnotify.h create mode 100644 core/fpdfdoc/ipvt_fontmap.h diff --git a/BUILD.gn b/BUILD.gn index 83f68fbe7c..8e552f31d6 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -239,33 +239,55 @@ static_library("fpdfdoc") { "core/fpdfdoc/clines.cpp", "core/fpdfdoc/clines.h", "core/fpdfdoc/cpdf_aaction.cpp", + "core/fpdfdoc/cpdf_aaction.h", "core/fpdfdoc/cpdf_action.cpp", + "core/fpdfdoc/cpdf_action.h", "core/fpdfdoc/cpdf_actionfields.cpp", + "core/fpdfdoc/cpdf_actionfields.h", "core/fpdfdoc/cpdf_annot.cpp", + "core/fpdfdoc/cpdf_annot.h", "core/fpdfdoc/cpdf_annotlist.cpp", + "core/fpdfdoc/cpdf_annotlist.h", "core/fpdfdoc/cpdf_apsettings.cpp", "core/fpdfdoc/cpdf_apsettings.h", "core/fpdfdoc/cpdf_bookmark.cpp", + "core/fpdfdoc/cpdf_bookmark.h", "core/fpdfdoc/cpdf_bookmarktree.cpp", + "core/fpdfdoc/cpdf_bookmarktree.h", "core/fpdfdoc/cpdf_defaultappearance.cpp", + "core/fpdfdoc/cpdf_defaultappearance.h", "core/fpdfdoc/cpdf_dest.cpp", + "core/fpdfdoc/cpdf_dest.h", "core/fpdfdoc/cpdf_docjsactions.cpp", + "core/fpdfdoc/cpdf_docjsactions.h", "core/fpdfdoc/cpdf_filespec.cpp", + "core/fpdfdoc/cpdf_filespec.h", "core/fpdfdoc/cpdf_formcontrol.cpp", + "core/fpdfdoc/cpdf_formcontrol.h", "core/fpdfdoc/cpdf_formfield.cpp", + "core/fpdfdoc/cpdf_formfield.h", "core/fpdfdoc/cpdf_iconfit.cpp", + "core/fpdfdoc/cpdf_iconfit.h", "core/fpdfdoc/cpdf_interform.cpp", + "core/fpdfdoc/cpdf_interform.h", "core/fpdfdoc/cpdf_link.cpp", + "core/fpdfdoc/cpdf_link.h", "core/fpdfdoc/cpdf_linklist.cpp", + "core/fpdfdoc/cpdf_linklist.h", "core/fpdfdoc/cpdf_metadata.cpp", + "core/fpdfdoc/cpdf_metadata.h", "core/fpdfdoc/cpdf_nametree.cpp", + "core/fpdfdoc/cpdf_nametree.h", "core/fpdfdoc/cpdf_numbertree.cpp", "core/fpdfdoc/cpdf_numbertree.h", "core/fpdfdoc/cpdf_occontext.cpp", + "core/fpdfdoc/cpdf_occontext.h", "core/fpdfdoc/cpdf_pagelabel.cpp", "core/fpdfdoc/cpdf_pagelabel.h", "core/fpdfdoc/cpdf_variabletext.cpp", + "core/fpdfdoc/cpdf_variabletext.h", "core/fpdfdoc/cpdf_viewerpreferences.cpp", + "core/fpdfdoc/cpdf_viewerpreferences.h", "core/fpdfdoc/cpvt_arraytemplate.h", "core/fpdfdoc/cpvt_color.cpp", "core/fpdfdoc/cpvt_color.h", @@ -275,48 +297,26 @@ static_library("fpdfdoc") { "core/fpdfdoc/cpvt_fontmap.h", "core/fpdfdoc/cpvt_generateap.cpp", "core/fpdfdoc/cpvt_generateap.h", + "core/fpdfdoc/cpvt_line.h", "core/fpdfdoc/cpvt_lineinfo.h", + "core/fpdfdoc/cpvt_secprops.h", + "core/fpdfdoc/cpvt_section.h", "core/fpdfdoc/cpvt_sectioninfo.cpp", "core/fpdfdoc/cpvt_sectioninfo.h", + "core/fpdfdoc/cpvt_word.h", "core/fpdfdoc/cpvt_wordinfo.cpp", "core/fpdfdoc/cpvt_wordinfo.h", + "core/fpdfdoc/cpvt_wordplace.h", + "core/fpdfdoc/cpvt_wordprops.h", + "core/fpdfdoc/cpvt_wordrange.h", "core/fpdfdoc/csection.cpp", "core/fpdfdoc/csection.h", "core/fpdfdoc/ctypeset.cpp", "core/fpdfdoc/ctypeset.h", "core/fpdfdoc/doc_tagged.cpp", - "core/fpdfdoc/include/cpdf_aaction.h", - "core/fpdfdoc/include/cpdf_action.h", - "core/fpdfdoc/include/cpdf_actionfields.h", - "core/fpdfdoc/include/cpdf_annot.h", - "core/fpdfdoc/include/cpdf_annotlist.h", - "core/fpdfdoc/include/cpdf_bookmark.h", - "core/fpdfdoc/include/cpdf_bookmarktree.h", - "core/fpdfdoc/include/cpdf_defaultappearance.h", - "core/fpdfdoc/include/cpdf_dest.h", - "core/fpdfdoc/include/cpdf_docjsactions.h", - "core/fpdfdoc/include/cpdf_filespec.h", - "core/fpdfdoc/include/cpdf_formcontrol.h", - "core/fpdfdoc/include/cpdf_formfield.h", - "core/fpdfdoc/include/cpdf_iconfit.h", - "core/fpdfdoc/include/cpdf_interform.h", - "core/fpdfdoc/include/cpdf_link.h", - "core/fpdfdoc/include/cpdf_linklist.h", - "core/fpdfdoc/include/cpdf_metadata.h", - "core/fpdfdoc/include/cpdf_nametree.h", - "core/fpdfdoc/include/cpdf_occontext.h", - "core/fpdfdoc/include/cpdf_variabletext.h", - "core/fpdfdoc/include/cpdf_viewerpreferences.h", - "core/fpdfdoc/include/cpvt_line.h", - "core/fpdfdoc/include/cpvt_secprops.h", - "core/fpdfdoc/include/cpvt_section.h", - "core/fpdfdoc/include/cpvt_word.h", - "core/fpdfdoc/include/cpvt_wordplace.h", - "core/fpdfdoc/include/cpvt_wordprops.h", - "core/fpdfdoc/include/cpvt_wordrange.h", - "core/fpdfdoc/include/fpdf_tagged.h", - "core/fpdfdoc/include/ipdf_formnotify.h", - "core/fpdfdoc/include/ipvt_fontmap.h", + "core/fpdfdoc/fpdf_tagged.h", + "core/fpdfdoc/ipdf_formnotify.h", + "core/fpdfdoc/ipvt_fontmap.h", "core/fpdfdoc/tagged_int.h", ] configs += [ ":pdfium_core_config" ] diff --git a/core/fpdfapi/cpdf_pagerendercontext.cpp b/core/fpdfapi/cpdf_pagerendercontext.cpp index 6a1918176c..e9a6f54aa2 100644 --- a/core/fpdfapi/cpdf_pagerendercontext.cpp +++ b/core/fpdfapi/cpdf_pagerendercontext.cpp @@ -9,8 +9,8 @@ #include "core/fpdfapi/fpdf_render/cpdf_progressiverenderer.h" #include "core/fpdfapi/fpdf_render/cpdf_rendercontext.h" #include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" -#include "core/fpdfdoc/include/cpdf_annotlist.h" -#include "core/fpdfdoc/include/cpdf_occontext.h" +#include "core/fpdfdoc/cpdf_annotlist.h" +#include "core/fpdfdoc/cpdf_occontext.h" #include "core/fxge/include/cfx_renderdevice.h" CPDF_PageRenderContext::CPDF_PageRenderContext() {} diff --git a/core/fpdfapi/fpdf_parser/cpdf_document.h b/core/fpdfapi/fpdf_parser/cpdf_document.h index cac9dfbfdf..46b4d7881b 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_document.h +++ b/core/fpdfapi/fpdf_parser/cpdf_document.h @@ -12,7 +12,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.h" #include "core/fpdfapi/fpdf_parser/cpdf_object.h" -#include "core/fpdfdoc/include/cpdf_linklist.h" +#include "core/fpdfdoc/cpdf_linklist.h" #include "core/fxcrt/include/cfx_string_pool_template.h" #include "core/fxcrt/include/cfx_weak_ptr.h" #include "core/fxcrt/include/fx_basic.h" diff --git a/core/fpdfapi/fpdf_render/fpdf_render.cpp b/core/fpdfapi/fpdf_render/fpdf_render.cpp index 19bfc1c3d0..d610670fd5 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render.cpp @@ -29,7 +29,7 @@ #include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" #include "core/fpdfapi/fpdf_render/cpdf_textrenderer.h" #include "core/fpdfapi/fpdf_render/cpdf_type3cache.h" -#include "core/fpdfdoc/include/cpdf_occontext.h" +#include "core/fpdfdoc/cpdf_occontext.h" #include "core/fxge/include/cfx_fxgedevice.h" #include "core/fxge/include/cfx_graphstatedata.h" #include "core/fxge/include/cfx_pathdata.h" diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp index cfb392d649..62b92c605b 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -23,7 +23,7 @@ #include "core/fpdfapi/fpdf_render/cpdf_pagerendercache.h" #include "core/fpdfapi/fpdf_render/cpdf_rendercontext.h" #include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" -#include "core/fpdfdoc/include/cpdf_occontext.h" +#include "core/fpdfdoc/cpdf_occontext.h" #include "core/fxcodec/include/fx_codec.h" #include "core/fxcrt/include/fx_safe_types.h" #include "core/fxge/include/cfx_fxgedevice.h" diff --git a/core/fpdfdoc/cline.h b/core/fpdfdoc/cline.h index a0cdbfd4af..6f95beb546 100644 --- a/core/fpdfdoc/cline.h +++ b/core/fpdfdoc/cline.h @@ -8,7 +8,7 @@ #define CORE_FPDFDOC_CLINE_H_ #include "core/fpdfdoc/cpvt_lineinfo.h" -#include "core/fpdfdoc/include/cpvt_wordplace.h" +#include "core/fpdfdoc/cpvt_wordplace.h" class CLine final { public: diff --git a/core/fpdfdoc/cpdf_aaction.cpp b/core/fpdfdoc/cpdf_aaction.cpp index 588c4c38df..da654b107d 100644 --- a/core/fpdfdoc/cpdf_aaction.cpp +++ b/core/fpdfdoc/cpdf_aaction.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_aaction.h" +#include "core/fpdfdoc/cpdf_aaction.h" namespace { diff --git a/core/fpdfdoc/cpdf_aaction.h b/core/fpdfdoc/cpdf_aaction.h new file mode 100644 index 0000000000..cef39f0407 --- /dev/null +++ b/core/fpdfdoc/cpdf_aaction.h @@ -0,0 +1,51 @@ +// 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_FPDFDOC_CPDF_AACTION_H_ +#define CORE_FPDFDOC_CPDF_AACTION_H_ + +#include "core/fpdfdoc/cpdf_action.h" + +class CPDF_Dictionary; + +class CPDF_AAction { + public: + enum AActionType { + CursorEnter = 0, + CursorExit, + ButtonDown, + ButtonUp, + GetFocus, + LoseFocus, + PageOpen, + PageClose, + PageVisible, + PageInvisible, + OpenPage, + ClosePage, + KeyStroke, + Format, + Validate, + Calculate, + CloseDocument, + SaveDocument, + DocumentSaved, + PrintDocument, + DocumentPrinted + }; + + CPDF_AAction() : m_pDict(nullptr) {} + explicit CPDF_AAction(CPDF_Dictionary* pDict) : m_pDict(pDict) {} + + FX_BOOL ActionExist(AActionType eType) const; + CPDF_Action GetAction(AActionType eType) const; + CPDF_Dictionary* GetDict() const { return m_pDict; } + + private: + CPDF_Dictionary* const m_pDict; +}; + +#endif // CORE_FPDFDOC_CPDF_AACTION_H_ diff --git a/core/fpdfdoc/cpdf_action.cpp b/core/fpdfdoc/cpdf_action.cpp index b6466217ca..d23925745e 100644 --- a/core/fpdfdoc/cpdf_action.cpp +++ b/core/fpdfdoc/cpdf_action.cpp @@ -4,12 +4,12 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_action.h" +#include "core/fpdfdoc/cpdf_action.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fpdfdoc/include/cpdf_filespec.h" -#include "core/fpdfdoc/include/cpdf_nametree.h" +#include "core/fpdfdoc/cpdf_filespec.h" +#include "core/fpdfdoc/cpdf_nametree.h" namespace { diff --git a/core/fpdfdoc/cpdf_action.h b/core/fpdfdoc/cpdf_action.h new file mode 100644 index 0000000000..7bef84d2e4 --- /dev/null +++ b/core/fpdfdoc/cpdf_action.h @@ -0,0 +1,59 @@ +// 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_FPDFDOC_CPDF_ACTION_H_ +#define CORE_FPDFDOC_CPDF_ACTION_H_ + +#include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" +#include "core/fpdfdoc/cpdf_dest.h" +#include "core/fxcrt/include/fx_string.h" + +class CPDF_Document; + +class CPDF_Action { + public: + enum ActionType { + Unknown = 0, + GoTo, + GoToR, + GoToE, + Launch, + Thread, + URI, + Sound, + Movie, + Hide, + Named, + SubmitForm, + ResetForm, + ImportData, + JavaScript, + SetOCGState, + Rendition, + Trans, + GoTo3DView + }; + + CPDF_Action() : m_pDict(nullptr) {} + explicit CPDF_Action(CPDF_Dictionary* pDict) : m_pDict(pDict) {} + + CPDF_Dictionary* GetDict() const { return m_pDict; } + ActionType GetType() const; + CPDF_Dest GetDest(CPDF_Document* pDoc) const; + CFX_WideString GetFilePath() const; + CFX_ByteString GetURI(CPDF_Document* pDoc) const; + bool GetHideStatus() const { return m_pDict->GetBooleanFor("H", true); } + CFX_ByteString GetNamedAction() const { return m_pDict->GetStringFor("N"); } + uint32_t GetFlags() const { return m_pDict->GetIntegerFor("Flags"); } + CFX_WideString GetJavaScript() const; + size_t GetSubActionsCount() const; + CPDF_Action GetSubAction(size_t iIndex) const; + + private: + CPDF_Dictionary* const m_pDict; +}; + +#endif // CORE_FPDFDOC_CPDF_ACTION_H_ diff --git a/core/fpdfdoc/cpdf_actionfields.cpp b/core/fpdfdoc/cpdf_actionfields.cpp index f9ac76e575..d87da28016 100644 --- a/core/fpdfdoc/cpdf_actionfields.cpp +++ b/core/fpdfdoc/cpdf_actionfields.cpp @@ -4,11 +4,11 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_actionfields.h" +#include "core/fpdfdoc/cpdf_actionfields.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" -#include "core/fpdfdoc/include/cpdf_action.h" +#include "core/fpdfdoc/cpdf_action.h" size_t CPDF_ActionFields::GetFieldsCount() const { if (!m_pAction) diff --git a/core/fpdfdoc/cpdf_actionfields.h b/core/fpdfdoc/cpdf_actionfields.h new file mode 100644 index 0000000000..9e0664cadb --- /dev/null +++ b/core/fpdfdoc/cpdf_actionfields.h @@ -0,0 +1,29 @@ +// 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_FPDFDOC_CPDF_ACTIONFIELDS_H_ +#define CORE_FPDFDOC_CPDF_ACTIONFIELDS_H_ + +#include + +#include + +class CPDF_Action; +class CPDF_Object; + +class CPDF_ActionFields { + public: + explicit CPDF_ActionFields(const CPDF_Action* pAction) : m_pAction(pAction) {} + + size_t GetFieldsCount() const; + std::vector GetAllFields() const; + CPDF_Object* GetField(size_t iIndex) const; + + private: + const CPDF_Action* const m_pAction; +}; + +#endif // CORE_FPDFDOC_CPDF_ACTIONFIELDS_H_ diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp index 7a85ad1f27..17b2d56bef 100644 --- a/core/fpdfdoc/cpdf_annot.cpp +++ b/core/fpdfdoc/cpdf_annot.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_annot.h" #include "core/fpdfapi/fpdf_page/cpdf_form.h" #include "core/fpdfapi/fpdf_page/cpdf_page.h" diff --git a/core/fpdfdoc/cpdf_annot.h b/core/fpdfdoc/cpdf_annot.h new file mode 100644 index 0000000000..f3166256d6 --- /dev/null +++ b/core/fpdfdoc/cpdf_annot.h @@ -0,0 +1,131 @@ +// 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_FPDFDOC_CPDF_ANNOT_H_ +#define CORE_FPDFDOC_CPDF_ANNOT_H_ + +#include +#include + +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_string.h" +#include "core/fxcrt/include/fx_system.h" + +class CFX_RenderDevice; +class CPDF_Dictionary; +class CPDF_Document; +class CPDF_Form; +class CPDF_Page; +class CPDF_RenderContext; +class CPDF_RenderOptions; +class CPDF_Stream; + +#define ANNOTFLAG_INVISIBLE 0x0001 +#define ANNOTFLAG_HIDDEN 0x0002 +#define ANNOTFLAG_PRINT 0x0004 +#define ANNOTFLAG_NOZOOM 0x0008 +#define ANNOTFLAG_NOROTATE 0x0010 +#define ANNOTFLAG_NOVIEW 0x0020 +#define ANNOTFLAG_READONLY 0x0040 +#define ANNOTFLAG_LOCKED 0x0080 +#define ANNOTFLAG_TOGGLENOVIEW 0x0100 + +class CPDF_Annot { + public: + enum AppearanceMode { Normal, Rollover, Down }; + enum class Subtype { + UNKNOWN = 0, + TEXT, + LINK, + FREETEXT, + LINE, + SQUARE, + CIRCLE, + POLYGON, + POLYLINE, + HIGHLIGHT, + UNDERLINE, + SQUIGGLY, + STRIKEOUT, + STAMP, + CARET, + INK, + POPUP, + FILEATTACHMENT, + SOUND, + MOVIE, + WIDGET, + SCREEN, + PRINTERMARK, + TRAPNET, + WATERMARK, + THREED, + RICHMEDIA, + XFAWIDGET + }; + + static bool IsAnnotationHidden(CPDF_Dictionary* pAnnotDict); + static CPDF_Annot::Subtype StringToAnnotSubtype( + const CFX_ByteString& sSubtype); + static CFX_ByteString AnnotSubtypeToString(CPDF_Annot::Subtype nSubtype); + static CFX_FloatRect RectFromQuadPoints(CPDF_Dictionary* pAnnotDict); + + CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument, bool bToOwnDict); + ~CPDF_Annot(); + + CPDF_Annot::Subtype GetSubtype() const; + uint32_t GetFlags() const; + CFX_FloatRect GetRect() const; + const CPDF_Dictionary* GetAnnotDict() const { return m_pAnnotDict; } + CPDF_Dictionary* GetAnnotDict() { return m_pAnnotDict; } + CPDF_Document* GetDocument() const { return m_pDocument; } + + FX_BOOL DrawAppearance(CPDF_Page* pPage, + CFX_RenderDevice* pDevice, + const CFX_Matrix* pUser2Device, + AppearanceMode mode, + const CPDF_RenderOptions* pOptions); + FX_BOOL DrawInContext(const CPDF_Page* pPage, + CPDF_RenderContext* pContext, + const CFX_Matrix* pUser2Device, + AppearanceMode mode); + + void ClearCachedAP(); + void DrawBorder(CFX_RenderDevice* pDevice, + const CFX_Matrix* pUser2Device, + const CPDF_RenderOptions* pOptions); + CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode); + void SetOpenState(bool bOpenState) { m_bOpenState = bOpenState; } + CPDF_Annot* GetPopupAnnot() const { return m_pPopupAnnot; } + void SetPopupAnnot(CPDF_Annot* pAnnot) { m_pPopupAnnot = pAnnot; } + + private: + void GenerateAPIfNeeded(); + bool ShouldDrawAnnotation(); + + CFX_FloatRect RectForDrawing() const; + + // For regular annotations, |m_pAnnotDict| is not owned. For + // our artificially created popup annotations, |m_pAnnotDict| + // is owned by this class. + bool m_bOwnedAnnotDict; + CPDF_Dictionary* m_pAnnotDict; + CPDF_Document* const m_pDocument; + CPDF_Annot::Subtype m_nSubtype; + std::map> m_APMap; + // |m_bOpenState| is only set for popup annotations. + bool m_bOpenState; + bool m_bHasGeneratedAP; + bool m_bIsTextMarkupAnnotation; + // Not owned. If there is a valid pointer in |m_pPopupAnnot|, + // then this annot is never a popup. + CPDF_Annot* m_pPopupAnnot; +}; + +CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, + CPDF_Annot::AppearanceMode mode); + +#endif // CORE_FPDFDOC_CPDF_ANNOT_H_ diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp index a76c341935..d19f9b4b70 100644 --- a/core/fpdfdoc/cpdf_annotlist.cpp +++ b/core/fpdfdoc/cpdf_annotlist.cpp @@ -4,16 +4,16 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_annotlist.h" +#include "core/fpdfdoc/cpdf_annotlist.h" #include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/cpdf_reference.h" #include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" +#include "core/fpdfdoc/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_occontext.h" #include "core/fpdfdoc/cpvt_generateap.h" -#include "core/fpdfdoc/include/cpdf_annot.h" -#include "core/fpdfdoc/include/cpdf_interform.h" -#include "core/fpdfdoc/include/cpdf_occontext.h" #include "core/fxge/include/cfx_renderdevice.h" namespace { diff --git a/core/fpdfdoc/cpdf_annotlist.h b/core/fpdfdoc/cpdf_annotlist.h new file mode 100644 index 0000000000..afe85f33af --- /dev/null +++ b/core/fpdfdoc/cpdf_annotlist.h @@ -0,0 +1,64 @@ +// 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_FPDFDOC_CPDF_ANNOTLIST_H_ +#define CORE_FPDFDOC_CPDF_ANNOTLIST_H_ + +#include +#include + +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_system.h" + +class CFX_RenderDevice; +class CPDF_Annot; +class CPDF_Document; +class CPDF_Page; +class CPDF_RenderContext; +class CPDF_RenderOptions; + +class CPDF_AnnotList { + public: + explicit CPDF_AnnotList(CPDF_Page* pPage); + ~CPDF_AnnotList(); + + void DisplayAnnots(CPDF_Page* pPage, + CPDF_RenderContext* pContext, + FX_BOOL bPrinting, + CFX_Matrix* pMatrix, + FX_BOOL bShowWidget, + CPDF_RenderOptions* pOptions); + + void DisplayAnnots(CPDF_Page* pPage, + CFX_RenderDevice* pDevice, + CPDF_RenderContext* pContext, + FX_BOOL bPrinting, + CFX_Matrix* pMatrix, + uint32_t dwAnnotFlags, + CPDF_RenderOptions* pOptions, + FX_RECT* pClipRect); + + size_t Count() const { return m_AnnotList.size(); } + CPDF_Annot* GetAt(size_t index) const { return m_AnnotList[index].get(); } + const std::vector>& All() const { + return m_AnnotList; + } + + private: + void DisplayPass(CPDF_Page* pPage, + CFX_RenderDevice* pDevice, + CPDF_RenderContext* pContext, + FX_BOOL bPrinting, + CFX_Matrix* pMatrix, + FX_BOOL bWidget, + CPDF_RenderOptions* pOptions, + FX_RECT* clip_rect); + + CPDF_Document* const m_pDocument; + std::vector> m_AnnotList; +}; + +#endif // CORE_FPDFDOC_CPDF_ANNOTLIST_H_ diff --git a/core/fpdfdoc/cpdf_apsettings.cpp b/core/fpdfdoc/cpdf_apsettings.cpp index 33d9b0648d..1c20792cf6 100644 --- a/core/fpdfdoc/cpdf_apsettings.cpp +++ b/core/fpdfdoc/cpdf_apsettings.cpp @@ -8,7 +8,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" -#include "core/fpdfdoc/include/cpdf_formcontrol.h" +#include "core/fpdfdoc/cpdf_formcontrol.h" CPDF_ApSettings::CPDF_ApSettings(CPDF_Dictionary* pDict) : m_pDict(pDict) {} diff --git a/core/fpdfdoc/cpdf_apsettings.h b/core/fpdfdoc/cpdf_apsettings.h index 860807efd2..4354ac071f 100644 --- a/core/fpdfdoc/cpdf_apsettings.h +++ b/core/fpdfdoc/cpdf_apsettings.h @@ -7,7 +7,7 @@ #ifndef CORE_FPDFDOC_CPDF_APSETTINGS_H_ #define CORE_FPDFDOC_CPDF_APSETTINGS_H_ -#include "core/fpdfdoc/include/cpdf_iconfit.h" +#include "core/fpdfdoc/cpdf_iconfit.h" #include "core/fxcrt/include/fx_string.h" #include "core/fxcrt/include/fx_system.h" #include "core/fxge/include/fx_dib.h" diff --git a/core/fpdfdoc/cpdf_bookmark.cpp b/core/fpdfdoc/cpdf_bookmark.cpp index b82cee8753..fb74567938 100644 --- a/core/fpdfdoc/cpdf_bookmark.cpp +++ b/core/fpdfdoc/cpdf_bookmark.cpp @@ -4,11 +4,11 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_bookmark.h" +#include "core/fpdfdoc/cpdf_bookmark.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_string.h" -#include "core/fpdfdoc/include/cpdf_nametree.h" +#include "core/fpdfdoc/cpdf_nametree.h" #include "core/fxge/include/fx_dib.h" uint32_t CPDF_Bookmark::GetColorRef() const { diff --git a/core/fpdfdoc/cpdf_bookmark.h b/core/fpdfdoc/cpdf_bookmark.h new file mode 100644 index 0000000000..b19ebbbd8c --- /dev/null +++ b/core/fpdfdoc/cpdf_bookmark.h @@ -0,0 +1,33 @@ +// 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_FPDFDOC_CPDF_BOOKMARK_H_ +#define CORE_FPDFDOC_CPDF_BOOKMARK_H_ + +#include "core/fpdfdoc/cpdf_action.h" +#include "core/fpdfdoc/cpdf_dest.h" +#include "core/fxcrt/include/fx_string.h" + +class CPDF_Dictionary; +class CPDF_Document; + +class CPDF_Bookmark { + public: + CPDF_Bookmark() : m_pDict(nullptr) {} + explicit CPDF_Bookmark(CPDF_Dictionary* pDict) : m_pDict(pDict) {} + + CPDF_Dictionary* GetDict() const { return m_pDict; } + uint32_t GetColorRef() const; + uint32_t GetFontStyle() const; + CFX_WideString GetTitle() const; + CPDF_Dest GetDest(CPDF_Document* pDocument) const; + CPDF_Action GetAction() const; + + private: + CPDF_Dictionary* m_pDict; +}; + +#endif // CORE_FPDFDOC_CPDF_BOOKMARK_H_ diff --git a/core/fpdfdoc/cpdf_bookmarktree.cpp b/core/fpdfdoc/cpdf_bookmarktree.cpp index 7ff4b09ad6..7ede3fefff 100644 --- a/core/fpdfdoc/cpdf_bookmarktree.cpp +++ b/core/fpdfdoc/cpdf_bookmarktree.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_bookmarktree.h" +#include "core/fpdfdoc/cpdf_bookmarktree.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" diff --git a/core/fpdfdoc/cpdf_bookmarktree.h b/core/fpdfdoc/cpdf_bookmarktree.h new file mode 100644 index 0000000000..7207357b1e --- /dev/null +++ b/core/fpdfdoc/cpdf_bookmarktree.h @@ -0,0 +1,26 @@ +// 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_FPDFDOC_CPDF_BOOKMARKTREE_H_ +#define CORE_FPDFDOC_CPDF_BOOKMARKTREE_H_ + +#include "core/fpdfdoc/cpdf_bookmark.h" + +class CPDF_Document; + +class CPDF_BookmarkTree { + public: + explicit CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {} + + CPDF_Bookmark GetFirstChild(const CPDF_Bookmark& parent) const; + CPDF_Bookmark GetNextSibling(const CPDF_Bookmark& bookmark) const; + CPDF_Document* GetDocument() const { return m_pDocument; } + + private: + CPDF_Document* const m_pDocument; +}; + +#endif // CORE_FPDFDOC_CPDF_BOOKMARKTREE_H_ diff --git a/core/fpdfdoc/cpdf_defaultappearance.cpp b/core/fpdfdoc/cpdf_defaultappearance.cpp index 40491786d7..39f2d23745 100644 --- a/core/fpdfdoc/cpdf_defaultappearance.cpp +++ b/core/fpdfdoc/cpdf_defaultappearance.cpp @@ -4,11 +4,11 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_defaultappearance.h" +#include "core/fpdfdoc/cpdf_defaultappearance.h" #include "core/fpdfapi/fpdf_parser/cpdf_simple_parser.h" #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" -#include "core/fpdfdoc/include/cpdf_formcontrol.h" +#include "core/fpdfdoc/cpdf_formcontrol.h" FX_BOOL CPDF_DefaultAppearance::HasFont() { if (m_csDA.IsEmpty()) diff --git a/core/fpdfdoc/cpdf_defaultappearance.h b/core/fpdfdoc/cpdf_defaultappearance.h new file mode 100644 index 0000000000..c09a5aacf4 --- /dev/null +++ b/core/fpdfdoc/cpdf_defaultappearance.h @@ -0,0 +1,52 @@ +// 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_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_ +#define CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_ + +#include "core/fpdfdoc/cpdf_defaultappearance.h" +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_string.h" +#include "core/fxcrt/include/fx_system.h" +#include "core/fxge/include/fx_dib.h" + +enum class BorderStyle { SOLID, DASH, BEVELED, INSET, UNDERLINE }; +enum class PaintOperation { STROKE, FILL }; + +class CPDF_DefaultAppearance { + public: + CPDF_DefaultAppearance() {} + explicit CPDF_DefaultAppearance(const CFX_ByteString& csDA) : m_csDA(csDA) {} + + CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) { + m_csDA = cDA.GetStr(); + } + + CFX_ByteString GetStr() const { return m_csDA; } + + FX_BOOL HasFont(); + CFX_ByteString GetFontString(); + void GetFont(CFX_ByteString& csFontNameTag, FX_FLOAT& fFontSize); + + FX_BOOL HasColor(PaintOperation nOperation = PaintOperation::FILL); + CFX_ByteString GetColorString( + PaintOperation nOperation = PaintOperation::FILL); + void GetColor(int& iColorType, + FX_FLOAT fc[4], + PaintOperation nOperation = PaintOperation::FILL); + void GetColor(FX_ARGB& color, + int& iColorType, + PaintOperation nOperation = PaintOperation::FILL); + + FX_BOOL HasTextMatrix(); + CFX_ByteString GetTextMatrixString(); + CFX_Matrix GetTextMatrix(); + + private: + CFX_ByteString m_csDA; +}; + +#endif // CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_ diff --git a/core/fpdfdoc/cpdf_dest.cpp b/core/fpdfdoc/cpdf_dest.cpp index 6a843c684f..da4b9a6f69 100644 --- a/core/fpdfdoc/cpdf_dest.cpp +++ b/core/fpdfdoc/cpdf_dest.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_dest.h" +#include "core/fpdfdoc/cpdf_dest.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" diff --git a/core/fpdfdoc/cpdf_dest.h b/core/fpdfdoc/cpdf_dest.h new file mode 100644 index 0000000000..7a966e26fe --- /dev/null +++ b/core/fpdfdoc/cpdf_dest.h @@ -0,0 +1,32 @@ +// 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_FPDFDOC_CPDF_DEST_H_ +#define CORE_FPDFDOC_CPDF_DEST_H_ + +#include "core/fxcrt/include/fx_string.h" +#include "core/fxcrt/include/fx_system.h" + +class CPDF_Document; +class CPDF_Object; + +class CPDF_Dest { + public: + CPDF_Dest() : m_pObj(nullptr) {} + explicit CPDF_Dest(CPDF_Object* pObj) : m_pObj(pObj) {} + + CPDF_Object* GetObject() const { return m_pObj; } + CFX_ByteString GetRemoteName(); + int GetPageIndex(CPDF_Document* pDoc); + uint32_t GetPageObjNum(); + int GetZoomMode(); + FX_FLOAT GetParam(int index); + + private: + CPDF_Object* m_pObj; +}; + +#endif // CORE_FPDFDOC_CPDF_DEST_H_ diff --git a/core/fpdfdoc/cpdf_docjsactions.cpp b/core/fpdfdoc/cpdf_docjsactions.cpp index 897cdac610..a7fcdfd071 100644 --- a/core/fpdfdoc/cpdf_docjsactions.cpp +++ b/core/fpdfdoc/cpdf_docjsactions.cpp @@ -4,9 +4,9 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_docjsactions.h" +#include "core/fpdfdoc/cpdf_docjsactions.h" -#include "core/fpdfdoc/include/cpdf_nametree.h" +#include "core/fpdfdoc/cpdf_nametree.h" CPDF_DocJSActions::CPDF_DocJSActions(CPDF_Document* pDoc) : m_pDocument(pDoc) {} diff --git a/core/fpdfdoc/cpdf_docjsactions.h b/core/fpdfdoc/cpdf_docjsactions.h new file mode 100644 index 0000000000..34b8b7ed9e --- /dev/null +++ b/core/fpdfdoc/cpdf_docjsactions.h @@ -0,0 +1,29 @@ +// 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_FPDFDOC_CPDF_DOCJSACTIONS_H_ +#define CORE_FPDFDOC_CPDF_DOCJSACTIONS_H_ + +#include "core/fpdfdoc/cpdf_action.h" +#include "core/fxcrt/include/fx_string.h" + +class CPDF_Document; + +class CPDF_DocJSActions { + public: + explicit CPDF_DocJSActions(CPDF_Document* pDoc); + + int CountJSActions() const; + CPDF_Action GetJSAction(int index, CFX_ByteString& csName) const; + CPDF_Action GetJSAction(const CFX_ByteString& csName) const; + int FindJSAction(const CFX_ByteString& csName) const; + CPDF_Document* GetDocument() const { return m_pDocument; } + + private: + CPDF_Document* const m_pDocument; +}; + +#endif // CORE_FPDFDOC_CPDF_DOCJSACTIONS_H_ diff --git a/core/fpdfdoc/cpdf_filespec.cpp b/core/fpdfdoc/cpdf_filespec.cpp index 6c30cdba81..51b8b356a5 100644 --- a/core/fpdfdoc/cpdf_filespec.cpp +++ b/core/fpdfdoc/cpdf_filespec.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_filespec.h" +#include "core/fpdfdoc/cpdf_filespec.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/cpdf_object.h" diff --git a/core/fpdfdoc/cpdf_filespec.h b/core/fpdfdoc/cpdf_filespec.h new file mode 100644 index 0000000000..c960a839f4 --- /dev/null +++ b/core/fpdfdoc/cpdf_filespec.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_FPDFDOC_CPDF_FILESPEC_H_ +#define CORE_FPDFDOC_CPDF_FILESPEC_H_ + +#include "core/fxcrt/include/cfx_string_pool_template.h" +#include "core/fxcrt/include/cfx_weak_ptr.h" +#include "core/fxcrt/include/fx_string.h" + +class CPDF_Object; + +class CPDF_FileSpec { + public: + explicit CPDF_FileSpec(const CFX_WeakPtr& pPool); + explicit CPDF_FileSpec(CPDF_Object* pObj) : m_pObj(pObj) {} + + // Convert a platform dependent file name into pdf format. + static CFX_WideString EncodeFileName(const CFX_WideStringC& filepath); + + // Convert a pdf file name into platform dependent format. + static CFX_WideString DecodeFileName(const CFX_WideStringC& filepath); + + CPDF_Object* GetObj() const { return m_pObj; } + bool GetFileName(CFX_WideString* wsFileName) const; + + // Set this file spec to refer to a file name (not a url). + void SetFileName(const CFX_WideStringC& wsFileName); + + private: + CPDF_Object* m_pObj; +}; + +#endif // CORE_FPDFDOC_CPDF_FILESPEC_H_ diff --git a/core/fpdfdoc/cpdf_filespec_unittest.cpp b/core/fpdfdoc/cpdf_filespec_unittest.cpp index b1b20e172b..c0f08dc480 100644 --- a/core/fpdfdoc/cpdf_filespec_unittest.cpp +++ b/core/fpdfdoc/cpdf_filespec_unittest.cpp @@ -8,7 +8,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/cpdf_name.h" #include "core/fpdfapi/fpdf_parser/cpdf_string.h" -#include "core/fpdfdoc/include/cpdf_filespec.h" +#include "core/fpdfdoc/cpdf_filespec.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/test_support.h" diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp index 24cb04478d..82a416f942 100644 --- a/core/fpdfdoc/cpdf_formcontrol.cpp +++ b/core/fpdfdoc/cpdf_formcontrol.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_formcontrol.h" +#include "core/fpdfdoc/cpdf_formcontrol.h" #include @@ -14,7 +14,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" #include "core/fpdfapi/fpdf_render/cpdf_rendercontext.h" -#include "core/fpdfdoc/include/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_interform.h" #include "core/fxge/include/cfx_renderdevice.h" namespace { diff --git a/core/fpdfdoc/cpdf_formcontrol.h b/core/fpdfdoc/cpdf_formcontrol.h new file mode 100644 index 0000000000..3f6cb537ce --- /dev/null +++ b/core/fpdfdoc/cpdf_formcontrol.h @@ -0,0 +1,134 @@ +// 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_FPDFDOC_CPDF_FORMCONTROL_H_ +#define CORE_FPDFDOC_CPDF_FORMCONTROL_H_ + +#include "core/fpdfdoc/cpdf_aaction.h" +#include "core/fpdfdoc/cpdf_action.h" +#include "core/fpdfdoc/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_annotlist.h" +#include "core/fpdfdoc/cpdf_apsettings.h" +#include "core/fpdfdoc/cpdf_defaultappearance.h" +#include "core/fpdfdoc/cpdf_formfield.h" +#include "core/fpdfdoc/cpdf_iconfit.h" +#include "core/fpdfdoc/ipdf_formnotify.h" +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_string.h" +#include "core/fxge/include/fx_dib.h" + +#define TEXTPOS_CAPTION 0 +#define TEXTPOS_ICON 1 +#define TEXTPOS_BELOW 2 +#define TEXTPOS_ABOVE 3 +#define TEXTPOS_RIGHT 4 +#define TEXTPOS_LEFT 5 +#define TEXTPOS_OVERLAID 6 + +#define COLORTYPE_TRANSPARENT 0 +#define COLORTYPE_GRAY 1 +#define COLORTYPE_RGB 2 +#define COLORTYPE_CMYK 3 + +class CFX_RenderDevice; +class CPDF_Dictionary; +class CPDF_Font; +class CPDF_FormField; +class CPDF_InterForm; +class CPDF_OCContext; +class CPDF_RenderOptions; +class CPDF_Stream; + +class CPDF_FormControl { + public: + enum HighlightingMode { None = 0, Invert, Outline, Push, Toggle }; + + CPDF_FormField::Type GetType() const { return m_pField->GetType(); } + CPDF_InterForm* GetInterForm() const { return m_pForm; } + CPDF_FormField* GetField() const { return m_pField; } + CPDF_Dictionary* GetWidget() const { return m_pWidgetDict; } + CFX_FloatRect GetRect() const { return m_pWidgetDict->GetRectFor("Rect"); } + + void DrawControl(CFX_RenderDevice* pDevice, + CFX_Matrix* pMatrix, + CPDF_Page* pPage, + CPDF_Annot::AppearanceMode mode, + const CPDF_RenderOptions* pOptions = nullptr); + + CFX_ByteString GetCheckedAPState(); + CFX_WideString GetExportValue() const; + + bool IsChecked() const; + bool IsDefaultChecked() const; + + HighlightingMode GetHighlightingMode(); + bool HasMKEntry(const CFX_ByteString& csEntry) const; + int GetRotation(); + + FX_ARGB GetBorderColor(int& iColorType) { return GetColor(iColorType, "BC"); } + + FX_FLOAT GetOriginalBorderColor(int index) { + return GetOriginalColor(index, "BC"); + } + + void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4]) { + GetOriginalColor(iColorType, fc, "BC"); + } + + FX_ARGB GetBackgroundColor(int& iColorType) { + return GetColor(iColorType, "BG"); + } + + FX_FLOAT GetOriginalBackgroundColor(int index) { + return GetOriginalColor(index, "BG"); + } + + void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4]) { + GetOriginalColor(iColorType, fc, "BG"); + } + + CFX_WideString GetNormalCaption() { return GetCaption("CA"); } + CFX_WideString GetRolloverCaption() { return GetCaption("RC"); } + CFX_WideString GetDownCaption() { return GetCaption("AC"); } + + CPDF_Stream* GetNormalIcon() { return GetIcon("I"); } + CPDF_Stream* GetRolloverIcon() { return GetIcon("RI"); } + CPDF_Stream* GetDownIcon() { return GetIcon("IX"); } + CPDF_IconFit GetIconFit(); + + int GetTextPosition(); + CPDF_Action GetAction(); + CPDF_AAction GetAdditionalAction(); + CPDF_DefaultAppearance GetDefaultAppearance(); + + CPDF_Font* GetDefaultControlFont(); + int GetControlAlignment(); + + private: + friend class CPDF_InterForm; + friend class CPDF_FormField; + + CPDF_FormControl(CPDF_FormField* pField, CPDF_Dictionary* pWidgetDict); + + CFX_ByteString GetOnStateName() const; + void SetOnStateName(const CFX_ByteString& csOn); + void CheckControl(FX_BOOL bChecked); + FX_ARGB GetColor(int& iColorType, const CFX_ByteString& csEntry); + FX_FLOAT GetOriginalColor(int index, const CFX_ByteString& csEntry); + void GetOriginalColor(int& iColorType, + FX_FLOAT fc[4], + const CFX_ByteString& csEntry); + + CFX_WideString GetCaption(const CFX_ByteString& csEntry); + CPDF_Stream* GetIcon(const CFX_ByteString& csEntry); + CPDF_ApSettings GetMK() const; + + CPDF_FormField* const m_pField; + CPDF_Dictionary* const m_pWidgetDict; + CPDF_InterForm* const m_pForm; +}; + +#endif // CORE_FPDFDOC_CPDF_FORMCONTROL_H_ diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp index d709a53a61..4b4ba7fb47 100644 --- a/core/fpdfdoc/cpdf_formfield.cpp +++ b/core/fpdfdoc/cpdf_formfield.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_formfield.h" +#include "core/fpdfdoc/cpdf_formfield.h" #include @@ -15,9 +15,9 @@ #include "core/fpdfapi/fpdf_parser/cpdf_simple_parser.h" #include "core/fpdfapi/fpdf_parser/cpdf_string.h" #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" +#include "core/fpdfdoc/cpdf_formcontrol.h" +#include "core/fpdfdoc/cpdf_interform.h" #include "core/fpdfdoc/cpvt_generateap.h" -#include "core/fpdfdoc/include/cpdf_formcontrol.h" -#include "core/fpdfdoc/include/cpdf_interform.h" #include "third_party/base/stl_util.h" namespace { diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h new file mode 100644 index 0000000000..1d83eb060c --- /dev/null +++ b/core/fpdfdoc/cpdf_formfield.h @@ -0,0 +1,168 @@ +// 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_FPDFDOC_CPDF_FORMFIELD_H_ +#define CORE_FPDFDOC_CPDF_FORMFIELD_H_ + +#include "core/fpdfdoc/cpdf_aaction.h" +#include "core/fpdfdoc/cpdf_formfield.h" +#include "core/fxcrt/include/fx_basic.h" +#include "core/fxcrt/include/fx_string.h" +#include "core/fxcrt/include/fx_system.h" + +#define FIELDTYPE_UNKNOWN 0 +#define FIELDTYPE_PUSHBUTTON 1 +#define FIELDTYPE_CHECKBOX 2 +#define FIELDTYPE_RADIOBUTTON 3 +#define FIELDTYPE_COMBOBOX 4 +#define FIELDTYPE_LISTBOX 5 +#define FIELDTYPE_TEXTFIELD 6 +#define FIELDTYPE_SIGNATURE 7 + +class CPDF_Dictionary; +class CPDF_Font; +class CPDF_FormControl; +class CPDF_InterForm; +class CPDF_String; + +CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, + const FX_CHAR* name, + int nLevel = 0); +CFX_WideString FPDF_GetFullName(CPDF_Dictionary* pFieldDict); + +class CPDF_FormField { + public: + enum Type { + Unknown, + PushButton, + RadioButton, + CheckBox, + Text, + RichText, + File, + ListBox, + ComboBox, + Sign + }; + + CFX_WideString GetFullName() const; + + Type GetType() const { return m_Type; } + uint32_t GetFlags() const { return m_Flags; } + + CPDF_Dictionary* GetFieldDict() const { return m_pDict; } + void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; } + + FX_BOOL ResetField(FX_BOOL bNotify = FALSE); + + int CountControls() const { return m_ControlList.GetSize(); } + + CPDF_FormControl* GetControl(int index) const { + return m_ControlList.GetAt(index); + } + + int GetControlIndex(const CPDF_FormControl* pControl) const; + int GetFieldType() const; + + CPDF_AAction GetAdditionalAction() const; + CFX_WideString GetAlternateName() const; + CFX_WideString GetMappingName() const; + + uint32_t GetFieldFlags() const; + CFX_ByteString GetDefaultStyle() const; + CFX_WideString GetRichTextString() const; + + CFX_WideString GetValue() const; + CFX_WideString GetDefaultValue() const; + FX_BOOL SetValue(const CFX_WideString& value, FX_BOOL bNotify = FALSE); + + int GetMaxLen() const; + int CountSelectedItems() const; + int GetSelectedIndex(int index) const; + + FX_BOOL ClearSelection(FX_BOOL bNotify = FALSE); + FX_BOOL IsItemSelected(int index) const; + FX_BOOL SetItemSelection(int index, + FX_BOOL bSelected, + FX_BOOL bNotify = FALSE); + + FX_BOOL IsItemDefaultSelected(int index) const; + + int GetDefaultSelectedItem() const; + int CountOptions() const; + + CFX_WideString GetOptionLabel(int index) const; + CFX_WideString GetOptionValue(int index) const; + + int FindOption(CFX_WideString csOptLabel) const; + int FindOptionValue(const CFX_WideString& csOptValue) const; + + FX_BOOL CheckControl(int iControlIndex, bool bChecked, bool bNotify = false); + + int GetTopVisibleIndex() const; + int CountSelectedOptions() const; + + int GetSelectedOptionIndex(int index) const; + FX_BOOL IsOptionSelected(int iOptIndex) const; + + FX_BOOL SelectOption(int iOptIndex, + FX_BOOL bSelected, + FX_BOOL bNotify = FALSE); + + FX_BOOL ClearSelectedOptions(FX_BOOL bNotify = FALSE); + +#ifdef PDF_ENABLE_XFA + FX_BOOL ClearOptions(FX_BOOL bNotify = FALSE); + + int InsertOption(CFX_WideString csOptLabel, + int index = -1, + FX_BOOL bNotify = FALSE); +#endif // PDF_ENABLE_XFA + + FX_FLOAT GetFontSize() const { return m_FontSize; } + CPDF_Font* GetFont() const { return m_pFont; } + + private: + friend class CPDF_InterForm; + friend class CPDF_FormControl; + + CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict); + ~CPDF_FormField(); + + CFX_WideString GetValue(FX_BOOL bDefault) const; + FX_BOOL SetValue(const CFX_WideString& value, + FX_BOOL bDefault, + FX_BOOL bNotify); + + void SyncFieldFlags(); + int FindListSel(CPDF_String* str); + CFX_WideString GetOptionText(int index, int sub_index) const; + + void LoadDA(); + CFX_WideString GetCheckValue(FX_BOOL bDefault) const; + FX_BOOL SetCheckValue(const CFX_WideString& value, + FX_BOOL bDefault, + FX_BOOL bNotify); + + bool NotifyBeforeSelectionChange(const CFX_WideString& value); + void NotifyAfterSelectionChange(); + + bool NotifyBeforeValueChange(const CFX_WideString& value); + void NotifyAfterValueChange(); + + bool NotifyListOrComboBoxBeforeChange(const CFX_WideString& value); + void NotifyListOrComboBoxAfterChange(); + + CPDF_FormField::Type m_Type; + uint32_t m_Flags; + CPDF_InterForm* m_pForm; + CPDF_Dictionary* m_pDict; + CFX_ArrayTemplate m_ControlList; + FX_FLOAT m_FontSize; + CPDF_Font* m_pFont; +}; + +#endif // CORE_FPDFDOC_CPDF_FORMFIELD_H_ diff --git a/core/fpdfdoc/cpdf_formfield_unittest.cpp b/core/fpdfdoc/cpdf_formfield_unittest.cpp index 6042fa9d9a..1fe5ee3838 100644 --- a/core/fpdfdoc/cpdf_formfield_unittest.cpp +++ b/core/fpdfdoc/cpdf_formfield_unittest.cpp @@ -4,7 +4,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.h" -#include "core/fpdfdoc/include/cpdf_formfield.h" +#include "core/fpdfdoc/cpdf_formfield.h" #include "testing/gtest/include/gtest/gtest.h" TEST(cpdf_formfield, FPDF_GetFullName) { diff --git a/core/fpdfdoc/cpdf_iconfit.cpp b/core/fpdfdoc/cpdf_iconfit.cpp index fe4fc9a02b..1b800b6be9 100644 --- a/core/fpdfdoc/cpdf_iconfit.cpp +++ b/core/fpdfdoc/cpdf_iconfit.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_iconfit.h" +#include "core/fpdfdoc/cpdf_iconfit.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" diff --git a/core/fpdfdoc/cpdf_iconfit.h b/core/fpdfdoc/cpdf_iconfit.h new file mode 100644 index 0000000000..746161475e --- /dev/null +++ b/core/fpdfdoc/cpdf_iconfit.h @@ -0,0 +1,30 @@ +// 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_FPDFDOC_CPDF_ICONFIT_H_ +#define CORE_FPDFDOC_CPDF_ICONFIT_H_ + +#include "core/fxcrt/include/fx_system.h" + +class CPDF_Dictionary; + +class CPDF_IconFit { + public: + enum ScaleMethod { Always = 0, Bigger, Smaller, Never }; + + explicit CPDF_IconFit(const CPDF_Dictionary* pDict) : m_pDict(pDict) {} + + ScaleMethod GetScaleMethod(); + FX_BOOL IsProportionalScale(); + void GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom); + bool GetFittingBounds(); + const CPDF_Dictionary* GetDict() const { return m_pDict; } + + private: + const CPDF_Dictionary* const m_pDict; +}; + +#endif // CORE_FPDFDOC_CPDF_ICONFIT_H_ diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index 7e54db2dae..00fff1acb4 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -13,9 +13,9 @@ #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/cpdf_string.h" -#include "core/fpdfdoc/include/cpdf_filespec.h" -#include "core/fpdfdoc/include/cpdf_formcontrol.h" -#include "core/fpdfdoc/include/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_filespec.h" +#include "core/fpdfdoc/cpdf_formcontrol.h" +#include "core/fpdfdoc/cpdf_interform.h" #include "core/fxge/include/cfx_substfont.h" #include "core/fxge/include/fx_font.h" #include "third_party/base/stl_util.h" diff --git a/core/fpdfdoc/cpdf_interform.h b/core/fpdfdoc/cpdf_interform.h new file mode 100644 index 0000000000..4c62a401b7 --- /dev/null +++ b/core/fpdfdoc/cpdf_interform.h @@ -0,0 +1,119 @@ +// 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_FPDFDOC_CPDF_INTERFORM_H_ +#define CORE_FPDFDOC_CPDF_INTERFORM_H_ + +#include +#include +#include + +#include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" +#include "core/fpdfdoc/cpdf_defaultappearance.h" +#include "core/fxcrt/include/fx_string.h" +#include "core/fxcrt/include/fx_system.h" + +class CFieldTree; +class CFDF_Document; +class CPDF_Document; +class CPDF_Dictionary; +class CPDF_Font; +class CPDF_FormControl; +class CPDF_FormField; +class CPDF_Object; +class CPDF_Page; +class IPDF_FormNotify; + +CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, + CPDF_Document* pDocument, + CFX_ByteString& csNameTag); + +class CPDF_InterForm { + public: + explicit CPDF_InterForm(CPDF_Document* pDocument); + ~CPDF_InterForm(); + + static void SetUpdateAP(bool bUpdateAP); + static bool IsUpdateAPEnabled(); + static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* pResDict, + const FX_CHAR* csType, + int iMinLen, + const FX_CHAR* csPrefix); + static CPDF_Font* AddStandardFont(CPDF_Document* pDocument, + CFX_ByteString csFontName); + static CFX_ByteString GetNativeFont(uint8_t iCharSet, void* pLogFont); + static uint8_t GetNativeCharSet(); + static CPDF_Font* AddNativeFont(uint8_t iCharSet, CPDF_Document* pDocument); + static CPDF_Font* AddNativeFont(CPDF_Document* pDocument); + + size_t CountFields(const CFX_WideString& csFieldName) const; + CPDF_FormField* GetField(uint32_t index, + const CFX_WideString& csFieldName) const; + CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const; + + CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage, + FX_FLOAT pdf_x, + FX_FLOAT pdf_y, + int* z_order) const; + CPDF_FormControl* GetControlByDict(const CPDF_Dictionary* pWidgetDict) const; + + FX_BOOL NeedConstructAP() const; + int CountFieldsInCalculationOrder(); + CPDF_FormField* GetFieldInCalculationOrder(int index); + int FindFieldInCalculationOrder(const CPDF_FormField* pField); + + CPDF_Font* GetFormFont(CFX_ByteString csNameTag); + CPDF_DefaultAppearance GetDefaultAppearance() const; + int GetFormAlignment() const; + + CPDF_FormField* CheckRequiredFields( + const std::vector* fields, + bool bIncludeOrExclude) const; + + CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, + bool bSimpleFileSpec) const; + CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, + const std::vector& fields, + bool bIncludeOrExclude, + bool bSimpleFileSpec) const; + + bool ResetForm(const std::vector& fields, + bool bIncludeOrExclude, + bool bNotify); + bool ResetForm(bool bNotify); + + void SetFormNotify(IPDF_FormNotify* pNotify); + FX_BOOL HasXFAForm() const; + void FixPageFields(const CPDF_Page* pPage); + + private: + friend class CPDF_FormControl; + friend class CPDF_FormField; + + void LoadField(CPDF_Dictionary* pFieldDict, int nLevel); + CPDF_FormField* AddTerminalField(CPDF_Dictionary* pFieldDict); + CPDF_FormControl* AddControl(CPDF_FormField* pField, + CPDF_Dictionary* pWidgetDict); + void FDF_ImportField(CPDF_Dictionary* pField, + const CFX_WideString& parent_name, + FX_BOOL bNotify = FALSE, + int nLevel = 0); + bool ValidateFieldName(CFX_WideString& csNewFieldName, + int iType, + const CPDF_FormField* pExcludedField, + const CPDF_FormControl* pExcludedControl) const; + + static bool s_bUpdateAP; + + CPDF_Document* const m_pDocument; + CPDF_Dictionary* m_pFormDict; + std::map m_ControlMap; + std::unique_ptr m_pFieldTree; + CFX_ByteString m_bsEncoding; + IPDF_FormNotify* m_pFormNotify; +}; + +#endif // CORE_FPDFDOC_CPDF_INTERFORM_H_ diff --git a/core/fpdfdoc/cpdf_link.cpp b/core/fpdfdoc/cpdf_link.cpp index 6cb53182a2..3c2df15f5a 100644 --- a/core/fpdfdoc/cpdf_link.cpp +++ b/core/fpdfdoc/cpdf_link.cpp @@ -4,10 +4,10 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_link.h" +#include "core/fpdfdoc/cpdf_link.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" -#include "core/fpdfdoc/include/cpdf_nametree.h" +#include "core/fpdfdoc/cpdf_nametree.h" CFX_FloatRect CPDF_Link::GetRect() { return m_pDict->GetRectFor("Rect"); diff --git a/core/fpdfdoc/cpdf_link.h b/core/fpdfdoc/cpdf_link.h new file mode 100644 index 0000000000..ce99573e91 --- /dev/null +++ b/core/fpdfdoc/cpdf_link.h @@ -0,0 +1,31 @@ +// 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_FPDFDOC_CPDF_LINK_H_ +#define CORE_FPDFDOC_CPDF_LINK_H_ + +#include "core/fpdfdoc/cpdf_action.h" +#include "core/fpdfdoc/cpdf_dest.h" +#include "core/fxcrt/include/fx_coordinates.h" + +class CPDF_Dictionary; + +class CPDF_Link { + public: + CPDF_Link() : m_pDict(nullptr) {} + explicit CPDF_Link(CPDF_Dictionary* pDict) : m_pDict(pDict) {} + + CPDF_Dictionary* GetDict() const { return m_pDict; } + + CFX_FloatRect GetRect(); + CPDF_Dest GetDest(CPDF_Document* pDoc); + CPDF_Action GetAction(); + + private: + CPDF_Dictionary* m_pDict; +}; + +#endif // CORE_FPDFDOC_CPDF_LINK_H_ diff --git a/core/fpdfdoc/cpdf_linklist.cpp b/core/fpdfdoc/cpdf_linklist.cpp index 326bdda339..d08032d40e 100644 --- a/core/fpdfdoc/cpdf_linklist.cpp +++ b/core/fpdfdoc/cpdf_linklist.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_linklist.h" +#include "core/fpdfdoc/cpdf_linklist.h" #include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" diff --git a/core/fpdfdoc/cpdf_linklist.h b/core/fpdfdoc/cpdf_linklist.h new file mode 100644 index 0000000000..d5c0432671 --- /dev/null +++ b/core/fpdfdoc/cpdf_linklist.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_FPDFDOC_CPDF_LINKLIST_H_ +#define CORE_FPDFDOC_CPDF_LINKLIST_H_ + +#include +#include + +#include "core/fpdfdoc/cpdf_link.h" +#include "core/fxcrt/include/fx_system.h" + +class CPDF_Page; +class CPDF_Dictionary; + +class CPDF_LinkList { + public: + CPDF_LinkList(); + ~CPDF_LinkList(); + + CPDF_Link GetLinkAtPoint(CPDF_Page* pPage, + FX_FLOAT pdf_x, + FX_FLOAT pdf_y, + int* z_order); + + private: + const std::vector* GetPageLinks(CPDF_Page* pPage); + void LoadPageLinks(CPDF_Page* pPage, std::vector* pList); + + std::map> m_PageMap; +}; + +#endif // CORE_FPDFDOC_CPDF_LINKLIST_H_ diff --git a/core/fpdfdoc/cpdf_metadata.cpp b/core/fpdfdoc/cpdf_metadata.cpp index 5fd8e920c8..8186c70c54 100644 --- a/core/fpdfdoc/cpdf_metadata.cpp +++ b/core/fpdfdoc/cpdf_metadata.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_metadata.h" +#include "core/fpdfdoc/cpdf_metadata.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" diff --git a/core/fpdfdoc/cpdf_metadata.h b/core/fpdfdoc/cpdf_metadata.h new file mode 100644 index 0000000000..dd68dda713 --- /dev/null +++ b/core/fpdfdoc/cpdf_metadata.h @@ -0,0 +1,26 @@ +// 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_FPDFDOC_CPDF_METADATA_H_ +#define CORE_FPDFDOC_CPDF_METADATA_H_ + +#include + +class CPDF_Document; +class CXML_Element; + +class CPDF_Metadata { + public: + explicit CPDF_Metadata(CPDF_Document* pDoc); + ~CPDF_Metadata(); + + const CXML_Element* GetRoot() const; + + private: + std::unique_ptr m_pXmlElement; +}; + +#endif // CORE_FPDFDOC_CPDF_METADATA_H_ diff --git a/core/fpdfdoc/cpdf_nametree.cpp b/core/fpdfdoc/cpdf_nametree.cpp index c8f6ebfa7c..37aab075c0 100644 --- a/core/fpdfdoc/cpdf_nametree.cpp +++ b/core/fpdfdoc/cpdf_nametree.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_nametree.h" +#include "core/fpdfdoc/cpdf_nametree.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" diff --git a/core/fpdfdoc/cpdf_nametree.h b/core/fpdfdoc/cpdf_nametree.h new file mode 100644 index 0000000000..45308b7de5 --- /dev/null +++ b/core/fpdfdoc/cpdf_nametree.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_FPDFDOC_CPDF_NAMETREE_H_ +#define CORE_FPDFDOC_CPDF_NAMETREE_H_ + +#include "core/fxcrt/include/fx_string.h" + +class CPDF_Array; +class CPDF_Dictionary; +class CPDF_Document; +class CPDF_Object; + +class CPDF_NameTree { + public: + explicit CPDF_NameTree(CPDF_Dictionary* pRoot) : m_pRoot(pRoot) {} + CPDF_NameTree(CPDF_Document* pDoc, const CFX_ByteString& category); + + CPDF_Object* LookupValue(int nIndex, CFX_ByteString& csName) const; + CPDF_Object* LookupValue(const CFX_ByteString& csName) const; + CPDF_Array* LookupNamedDest(CPDF_Document* pDoc, const CFX_ByteString& sName); + + int GetIndex(const CFX_ByteString& csName) const; + size_t GetCount() const; + CPDF_Dictionary* GetRoot() const { return m_pRoot; } + + private: + CPDF_Dictionary* m_pRoot; +}; + +#endif // CORE_FPDFDOC_CPDF_NAMETREE_H_ diff --git a/core/fpdfdoc/cpdf_occontext.cpp b/core/fpdfdoc/cpdf_occontext.cpp index 6cb007514e..d2994ac010 100644 --- a/core/fpdfdoc/cpdf_occontext.cpp +++ b/core/fpdfdoc/cpdf_occontext.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_occontext.h" +#include "core/fpdfdoc/cpdf_occontext.h" #include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" diff --git a/core/fpdfdoc/cpdf_occontext.h b/core/fpdfdoc/cpdf_occontext.h new file mode 100644 index 0000000000..5c850b9400 --- /dev/null +++ b/core/fpdfdoc/cpdf_occontext.h @@ -0,0 +1,42 @@ +// 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_FPDFDOC_CPDF_OCCONTEXT_H_ +#define CORE_FPDFDOC_CPDF_OCCONTEXT_H_ + +#include + +#include "core/fxcrt/include/fx_string.h" + +class CPDF_Array; +class CPDF_Dictionary; +class CPDF_Document; +class CPDF_PageObject; + +class CPDF_OCContext { + public: + enum UsageType { View = 0, Design, Print, Export }; + + CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType); + ~CPDF_OCContext(); + + bool CheckOCGVisible(const CPDF_Dictionary* pOCGDict); + bool CheckObjectVisible(const CPDF_PageObject* pObj); + + private: + bool LoadOCGStateFromConfig(const CFX_ByteString& csConfig, + const CPDF_Dictionary* pOCGDict) const; + bool LoadOCGState(const CPDF_Dictionary* pOCGDict) const; + bool GetOCGVisible(const CPDF_Dictionary* pOCGDict); + bool GetOCGVE(CPDF_Array* pExpression, int nLevel); + bool LoadOCMDState(const CPDF_Dictionary* pOCMDDict); + + CPDF_Document* const m_pDocument; + const UsageType m_eUsageType; + std::unordered_map m_OCGStates; +}; + +#endif // CORE_FPDFDOC_CPDF_OCCONTEXT_H_ diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp index d8f8f5a9aa..4ac6c6b1f9 100644 --- a/core/fpdfdoc/cpdf_variabletext.cpp +++ b/core/fpdfdoc/cpdf_variabletext.cpp @@ -4,15 +4,15 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_variabletext.h" +#include "core/fpdfdoc/cpdf_variabletext.h" #include "core/fpdfapi/fpdf_font/cpdf_font.h" #include "core/fpdfdoc/cline.h" +#include "core/fpdfdoc/cpvt_section.h" +#include "core/fpdfdoc/cpvt_word.h" #include "core/fpdfdoc/cpvt_wordinfo.h" #include "core/fpdfdoc/csection.h" -#include "core/fpdfdoc/include/cpvt_section.h" -#include "core/fpdfdoc/include/cpvt_word.h" -#include "core/fpdfdoc/include/ipvt_fontmap.h" +#include "core/fpdfdoc/ipvt_fontmap.h" namespace { diff --git a/core/fpdfdoc/cpdf_variabletext.h b/core/fpdfdoc/cpdf_variabletext.h new file mode 100644 index 0000000000..cc13b33f30 --- /dev/null +++ b/core/fpdfdoc/cpdf_variabletext.h @@ -0,0 +1,245 @@ +// 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_FPDFDOC_CPDF_VARIABLETEXT_H_ +#define CORE_FPDFDOC_CPDF_VARIABLETEXT_H_ + +#include + +#include "core/fpdfdoc/cpvt_arraytemplate.h" +#include "core/fpdfdoc/cpvt_floatrect.h" +#include "core/fpdfdoc/cpvt_line.h" +#include "core/fpdfdoc/cpvt_lineinfo.h" +#include "core/fpdfdoc/cpvt_wordplace.h" +#include "core/fpdfdoc/cpvt_wordrange.h" +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_string.h" +#include "core/fxcrt/include/fx_system.h" +#include "core/fxge/include/fx_font.h" + +class CSection; +class IPVT_FontMap; + +struct CPVT_SecProps; +struct CPVT_Section; +struct CPVT_SectionInfo; +struct CPVT_Word; +struct CPVT_WordInfo; +struct CPVT_WordProps; + +#define VARIABLETEXT_HALF 0.5f + +class CPDF_VariableText { + public: + enum class ScriptType { Normal, Super, Sub }; + + class Iterator { + public: + explicit Iterator(CPDF_VariableText* pVT); + ~Iterator(); + + FX_BOOL NextWord(); + FX_BOOL PrevWord(); + FX_BOOL NextLine(); + FX_BOOL PrevLine(); + FX_BOOL NextSection(); + FX_BOOL PrevSection(); + FX_BOOL SetWord(const CPVT_Word& word); + FX_BOOL GetWord(CPVT_Word& word) const; + FX_BOOL GetLine(CPVT_Line& line) const; + FX_BOOL GetSection(CPVT_Section& section) const; + FX_BOOL SetSection(const CPVT_Section& section); + void SetAt(int32_t nWordIndex); + void SetAt(const CPVT_WordPlace& place); + const CPVT_WordPlace& GetAt() const { return m_CurPos; } + + private: + CPVT_WordPlace m_CurPos; + CPDF_VariableText* const m_pVT; + }; + + class Provider { + public: + explicit Provider(IPVT_FontMap* pFontMap); + virtual ~Provider(); + + virtual int32_t GetCharWidth(int32_t nFontIndex, uint16_t word); + virtual int32_t GetTypeAscent(int32_t nFontIndex); + virtual int32_t GetTypeDescent(int32_t nFontIndex); + virtual int32_t GetWordFontIndex(uint16_t word, + int32_t charset, + int32_t nFontIndex); + virtual FX_BOOL IsLatinWord(uint16_t word); + virtual int32_t GetDefaultFontIndex(); + + private: + IPVT_FontMap* const m_pFontMap; + }; + + CPDF_VariableText(); + ~CPDF_VariableText(); + + void SetProvider(CPDF_VariableText::Provider* pProvider); + CPDF_VariableText::Iterator* GetIterator(); + + void SetContentRect(const CPVT_FloatRect& rect); + CFX_FloatRect GetContentRect() const; + void SetPlateRect(const CFX_FloatRect& rect); + const CFX_FloatRect& GetPlateRect() const; + + void SetAlignment(int32_t nFormat) { m_nAlignment = nFormat; } + void SetPasswordChar(uint16_t wSubWord) { m_wSubWord = wSubWord; } + void SetLimitChar(int32_t nLimitChar) { m_nLimitChar = nLimitChar; } + void SetCharSpace(FX_FLOAT fCharSpace) { m_fCharSpace = fCharSpace; } + void SetMultiLine(FX_BOOL bMultiLine) { m_bMultiLine = bMultiLine; } + void SetAutoReturn(FX_BOOL bAuto) { m_bLimitWidth = bAuto; } + void SetFontSize(FX_FLOAT fFontSize) { m_fFontSize = fFontSize; } + void SetCharArray(int32_t nCharArray) { m_nCharArray = nCharArray; } + void SetAutoFontSize(FX_BOOL bAuto) { m_bAutoFontSize = bAuto; } + void Initialize(); + + FX_BOOL IsValid() const { return m_bInitial; } + + void RearrangeAll(); + void RearrangePart(const CPVT_WordRange& PlaceRange); + void ResetAll(); + void SetText(const CFX_WideString& text); + CPVT_WordPlace InsertWord(const CPVT_WordPlace& place, + uint16_t word, + int32_t charset, + const CPVT_WordProps* pWordProps); + CPVT_WordPlace InsertSection(const CPVT_WordPlace& place, + const CPVT_SecProps* pSecProps, + const CPVT_WordProps* pWordProps); + CPVT_WordPlace InsertText(const CPVT_WordPlace& place, const FX_WCHAR* text); + CPVT_WordPlace DeleteWords(const CPVT_WordRange& PlaceRange); + CPVT_WordPlace DeleteWord(const CPVT_WordPlace& place); + CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace& place); + + int32_t GetTotalWords() const; + FX_FLOAT GetFontSize() const { return m_fFontSize; } + int32_t GetAlignment() const { return m_nAlignment; } + uint16_t GetPasswordChar() const { return GetSubWord(); } + int32_t GetCharArray() const { return m_nCharArray; } + int32_t GetLimitChar() const { return m_nLimitChar; } + FX_BOOL IsMultiLine() const { return m_bMultiLine; } + int32_t GetHorzScale() const { return m_nHorzScale; } + FX_FLOAT GetCharSpace() const { return m_fCharSpace; } + CPVT_WordPlace GetBeginWordPlace() const; + CPVT_WordPlace GetEndWordPlace() const; + CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace& place) const; + CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace& place) const; + CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const; + CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace& place, + const CFX_FloatPoint& point) const; + CPVT_WordPlace GetDownWordPlace(const CPVT_WordPlace& place, + const CFX_FloatPoint& point) const; + CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace& place) const; + CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace& place) const; + CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace& place) const; + CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace& place) const; + void UpdateWordPlace(CPVT_WordPlace& place) const; + CPVT_WordPlace AdjustLineHeader(const CPVT_WordPlace& place, + FX_BOOL bPrevOrNext) const; + int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const; + CPVT_WordPlace WordIndexToWordPlace(int32_t index) const; + + uint16_t GetSubWord() const { return m_wSubWord; } + + FX_FLOAT GetPlateWidth() const { return m_rcPlate.right - m_rcPlate.left; } + FX_FLOAT GetPlateHeight() const { return m_rcPlate.top - m_rcPlate.bottom; } + CFX_SizeF GetPlateSize() const; + CFX_FloatPoint GetBTPoint() const; + CFX_FloatPoint GetETPoint() const; + + CFX_FloatPoint InToOut(const CFX_FloatPoint& point) const; + CFX_FloatPoint OutToIn(const CFX_FloatPoint& point) const; + CFX_FloatRect InToOut(const CPVT_FloatRect& rect) const; + CPVT_FloatRect OutToIn(const CFX_FloatRect& rect) const; + + private: + friend class CTypeset; + friend class CSection; + + int32_t GetCharWidth(int32_t nFontIndex, uint16_t Word, uint16_t SubWord); + int32_t GetTypeAscent(int32_t nFontIndex); + int32_t GetTypeDescent(int32_t nFontIndex); + int32_t GetWordFontIndex(uint16_t word, int32_t charset, int32_t nFontIndex); + int32_t GetDefaultFontIndex(); + FX_BOOL IsLatinWord(uint16_t word); + + CPVT_WordPlace AddSection(const CPVT_WordPlace& place, + const CPVT_SectionInfo& secinfo); + CPVT_WordPlace AddLine(const CPVT_WordPlace& place, + const CPVT_LineInfo& lineinfo); + CPVT_WordPlace AddWord(const CPVT_WordPlace& place, + const CPVT_WordInfo& wordinfo); + FX_BOOL GetWordInfo(const CPVT_WordPlace& place, CPVT_WordInfo& wordinfo); + FX_BOOL SetWordInfo(const CPVT_WordPlace& place, + const CPVT_WordInfo& wordinfo); + FX_BOOL GetLineInfo(const CPVT_WordPlace& place, CPVT_LineInfo& lineinfo); + FX_BOOL GetSectionInfo(const CPVT_WordPlace& place, + CPVT_SectionInfo& secinfo); + FX_FLOAT GetWordFontSize(const CPVT_WordInfo& WordInfo); + FX_FLOAT GetWordWidth(int32_t nFontIndex, + uint16_t Word, + uint16_t SubWord, + FX_FLOAT fCharSpace, + int32_t nHorzScale, + FX_FLOAT fFontSize, + FX_FLOAT fWordTail); + FX_FLOAT GetWordWidth(const CPVT_WordInfo& WordInfo); + FX_FLOAT GetWordAscent(const CPVT_WordInfo& WordInfo, FX_FLOAT fFontSize); + FX_FLOAT GetWordDescent(const CPVT_WordInfo& WordInfo, FX_FLOAT fFontSize); + FX_FLOAT GetWordAscent(const CPVT_WordInfo& WordInfo); + FX_FLOAT GetWordDescent(const CPVT_WordInfo& WordInfo); + FX_FLOAT GetLineAscent(const CPVT_SectionInfo& SecInfo); + FX_FLOAT GetLineDescent(const CPVT_SectionInfo& SecInfo); + FX_FLOAT GetFontAscent(int32_t nFontIndex, FX_FLOAT fFontSize); + FX_FLOAT GetFontDescent(int32_t nFontIndex, FX_FLOAT fFontSize); + int32_t GetWordFontIndex(const CPVT_WordInfo& WordInfo); + FX_FLOAT GetCharSpace(const CPVT_WordInfo& WordInfo); + int32_t GetHorzScale(const CPVT_WordInfo& WordInfo); + FX_FLOAT GetLineLeading(const CPVT_SectionInfo& SecInfo); + FX_FLOAT GetLineIndent(const CPVT_SectionInfo& SecInfo); + int32_t GetAlignment(const CPVT_SectionInfo& SecInfo); + + void ClearSectionRightWords(const CPVT_WordPlace& place); + + FX_BOOL ClearEmptySection(const CPVT_WordPlace& place); + void ClearEmptySections(const CPVT_WordRange& PlaceRange); + void LinkLatterSection(const CPVT_WordPlace& place); + void ClearWords(const CPVT_WordRange& PlaceRange); + CPVT_WordPlace ClearLeftWord(const CPVT_WordPlace& place); + CPVT_WordPlace ClearRightWord(const CPVT_WordPlace& place); + + CPVT_FloatRect Rearrange(const CPVT_WordRange& PlaceRange); + FX_FLOAT GetAutoFontSize(); + bool IsBigger(FX_FLOAT fFontSize) const; + CPVT_FloatRect RearrangeSections(const CPVT_WordRange& PlaceRange); + + void ResetSectionArray(); + + CPVT_ArrayTemplate m_SectionArray; + int32_t m_nLimitChar; + int32_t m_nCharArray; + FX_BOOL m_bMultiLine; + FX_BOOL m_bLimitWidth; + FX_BOOL m_bAutoFontSize; + int32_t m_nAlignment; + FX_FLOAT m_fLineLeading; + FX_FLOAT m_fCharSpace; + int32_t m_nHorzScale; + uint16_t m_wSubWord; + FX_FLOAT m_fFontSize; + FX_BOOL m_bInitial; + CPDF_VariableText::Provider* m_pVTProvider; + std::unique_ptr m_pVTIterator; + CFX_FloatRect m_rcPlate; + CPVT_FloatRect m_rcContent; +}; + +#endif // CORE_FPDFDOC_CPDF_VARIABLETEXT_H_ diff --git a/core/fpdfdoc/cpdf_viewerpreferences.cpp b/core/fpdfdoc/cpdf_viewerpreferences.cpp index 5ebe2bb11e..98e22b3d44 100644 --- a/core/fpdfdoc/cpdf_viewerpreferences.cpp +++ b/core/fpdfdoc/cpdf_viewerpreferences.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdfdoc/include/cpdf_viewerpreferences.h" +#include "core/fpdfdoc/cpdf_viewerpreferences.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" diff --git a/core/fpdfdoc/cpdf_viewerpreferences.h b/core/fpdfdoc/cpdf_viewerpreferences.h new file mode 100644 index 0000000000..9375e85b25 --- /dev/null +++ b/core/fpdfdoc/cpdf_viewerpreferences.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_FPDFDOC_CPDF_VIEWERPREFERENCES_H_ +#define CORE_FPDFDOC_CPDF_VIEWERPREFERENCES_H_ + +#include "core/fxcrt/include/fx_string.h" +#include "core/fxcrt/include/fx_system.h" + +class CPDF_Array; +class CPDF_Dictionary; +class CPDF_Document; + +class CPDF_ViewerPreferences { + public: + explicit CPDF_ViewerPreferences(CPDF_Document* pDoc); + ~CPDF_ViewerPreferences(); + + FX_BOOL IsDirectionR2L() const; + FX_BOOL PrintScaling() const; + int32_t NumCopies() const; + CPDF_Array* PrintPageRange() const; + CFX_ByteString Duplex() const; + + private: + CPDF_Dictionary* GetViewerPreferences() const; + + CPDF_Document* const m_pDoc; +}; + +#endif // CORE_FPDFDOC_CPDF_VIEWERPREFERENCES_H_ diff --git a/core/fpdfdoc/cpvt_fontmap.cpp b/core/fpdfdoc/cpvt_fontmap.cpp index cb600fb3a4..908f69f761 100644 --- a/core/fpdfdoc/cpvt_fontmap.cpp +++ b/core/fpdfdoc/cpvt_fontmap.cpp @@ -9,7 +9,7 @@ #include "core/fpdfapi/fpdf_font/cpdf_font.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fpdfdoc/include/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_interform.h" CPVT_FontMap::CPVT_FontMap(CPDF_Document* pDoc, CPDF_Dictionary* pResDict, diff --git a/core/fpdfdoc/cpvt_fontmap.h b/core/fpdfdoc/cpvt_fontmap.h index 5c9b4ab5d0..d5ec87948d 100644 --- a/core/fpdfdoc/cpvt_fontmap.h +++ b/core/fpdfdoc/cpvt_fontmap.h @@ -9,7 +9,7 @@ #include -#include "core/fpdfdoc/include/ipvt_fontmap.h" +#include "core/fpdfdoc/ipvt_fontmap.h" #include "core/fxcrt/include/fx_string.h" class CPDF_Document; diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index 96e11d38ad..c09503614f 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -14,11 +14,11 @@ #include "core/fpdfapi/fpdf_parser/cpdf_simple_parser.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" +#include "core/fpdfdoc/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_formfield.h" #include "core/fpdfdoc/cpvt_color.h" #include "core/fpdfdoc/cpvt_fontmap.h" -#include "core/fpdfdoc/include/cpdf_annot.h" -#include "core/fpdfdoc/include/cpdf_formfield.h" -#include "core/fpdfdoc/include/cpvt_word.h" +#include "core/fpdfdoc/cpvt_word.h" namespace { diff --git a/core/fpdfdoc/cpvt_generateap.h b/core/fpdfdoc/cpvt_generateap.h index 3fbc4cc591..603d4458f4 100644 --- a/core/fpdfdoc/cpvt_generateap.h +++ b/core/fpdfdoc/cpvt_generateap.h @@ -7,10 +7,10 @@ #ifndef CORE_FPDFDOC_CPVT_GENERATEAP_H_ #define CORE_FPDFDOC_CPVT_GENERATEAP_H_ +#include "core/fpdfdoc/cpdf_defaultappearance.h" +#include "core/fpdfdoc/cpdf_variabletext.h" #include "core/fpdfdoc/cpvt_color.h" #include "core/fpdfdoc/cpvt_dash.h" -#include "core/fpdfdoc/include/cpdf_defaultappearance.h" -#include "core/fpdfdoc/include/cpdf_variabletext.h" #include "core/fxcrt/include/fx_coordinates.h" #include "core/fxcrt/include/fx_string.h" #include "core/fxcrt/include/fx_system.h" diff --git a/core/fpdfdoc/cpvt_line.h b/core/fpdfdoc/cpvt_line.h new file mode 100644 index 0000000000..70e3b7f40b --- /dev/null +++ b/core/fpdfdoc/cpvt_line.h @@ -0,0 +1,25 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FPDFDOC_CPVT_LINE_H_ +#define CORE_FPDFDOC_CPVT_LINE_H_ + +#include "core/fpdfdoc/cpvt_wordplace.h" +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_system.h" + +struct CPVT_Line { + CPVT_Line() : fLineWidth(0.0f), fLineAscent(0.0f), fLineDescent(0.0f) {} + + CPVT_WordPlace lineplace; + CPVT_WordPlace lineEnd; + CFX_FloatPoint ptLine; + FX_FLOAT fLineWidth; + FX_FLOAT fLineAscent; + FX_FLOAT fLineDescent; +}; + +#endif // CORE_FPDFDOC_CPVT_LINE_H_ diff --git a/core/fpdfdoc/cpvt_secprops.h b/core/fpdfdoc/cpvt_secprops.h new file mode 100644 index 0000000000..e5c633f2c4 --- /dev/null +++ b/core/fpdfdoc/cpvt_secprops.h @@ -0,0 +1,30 @@ +// 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_FPDFDOC_CPVT_SECPROPS_H_ +#define CORE_FPDFDOC_CPVT_SECPROPS_H_ + +#include "core/fxcrt/include/fx_system.h" + +struct CPVT_SecProps { + CPVT_SecProps() : fLineLeading(0.0f), fLineIndent(0.0f), nAlignment(0) {} + + CPVT_SecProps(FX_FLOAT lineLeading, FX_FLOAT lineIndent, int32_t alignment) + : fLineLeading(lineLeading), + fLineIndent(lineIndent), + nAlignment(alignment) {} + + CPVT_SecProps(const CPVT_SecProps& other) + : fLineLeading(other.fLineLeading), + fLineIndent(other.fLineIndent), + nAlignment(other.nAlignment) {} + + FX_FLOAT fLineLeading; + FX_FLOAT fLineIndent; + int32_t nAlignment; +}; + +#endif // CORE_FPDFDOC_CPVT_SECPROPS_H_ diff --git a/core/fpdfdoc/cpvt_section.h b/core/fpdfdoc/cpvt_section.h new file mode 100644 index 0000000000..ae122902d8 --- /dev/null +++ b/core/fpdfdoc/cpvt_section.h @@ -0,0 +1,22 @@ +// 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_FPDFDOC_CPVT_SECTION_H_ +#define CORE_FPDFDOC_CPVT_SECTION_H_ + +#include "core/fpdfdoc/cpvt_secprops.h" +#include "core/fpdfdoc/cpvt_wordplace.h" +#include "core/fpdfdoc/cpvt_wordprops.h" +#include "core/fxcrt/include/fx_coordinates.h" + +struct CPVT_Section { + CPVT_WordPlace secplace; + CFX_FloatRect rcSection; + CPVT_SecProps SecProps; + CPVT_WordProps WordProps; +}; + +#endif // CORE_FPDFDOC_CPVT_SECTION_H_ diff --git a/core/fpdfdoc/cpvt_sectioninfo.h b/core/fpdfdoc/cpvt_sectioninfo.h index 9d9b99fc27..6422efe868 100644 --- a/core/fpdfdoc/cpvt_sectioninfo.h +++ b/core/fpdfdoc/cpvt_sectioninfo.h @@ -10,8 +10,8 @@ #include #include "core/fpdfdoc/cpvt_floatrect.h" -#include "core/fpdfdoc/include/cpvt_secprops.h" -#include "core/fpdfdoc/include/cpvt_wordprops.h" +#include "core/fpdfdoc/cpvt_secprops.h" +#include "core/fpdfdoc/cpvt_wordprops.h" struct CPVT_SectionInfo { CPVT_SectionInfo(); diff --git a/core/fpdfdoc/cpvt_word.h b/core/fpdfdoc/cpvt_word.h new file mode 100644 index 0000000000..1e3b5aa0bd --- /dev/null +++ b/core/fpdfdoc/cpvt_word.h @@ -0,0 +1,38 @@ +// 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_FPDFDOC_CPVT_WORD_H_ +#define CORE_FPDFDOC_CPVT_WORD_H_ + +#include "core/fpdfdoc/cpvt_wordplace.h" +#include "core/fpdfdoc/cpvt_wordprops.h" +#include "core/fxcrt/include/fx_system.h" + +struct CPVT_Word { + CPVT_Word(); + + uint16_t Word; + int32_t nCharset; + CPVT_WordPlace WordPlace; + CFX_FloatPoint ptWord; + FX_FLOAT fAscent; + FX_FLOAT fDescent; + FX_FLOAT fWidth; + int32_t nFontIndex; + FX_FLOAT fFontSize; + CPVT_WordProps WordProps; +}; + +inline CPVT_Word::CPVT_Word() + : Word(0), + nCharset(0), + fAscent(0.0f), + fDescent(0.0f), + fWidth(0.0f), + nFontIndex(-1), + fFontSize(0.0f) {} + +#endif // CORE_FPDFDOC_CPVT_WORD_H_ diff --git a/core/fpdfdoc/cpvt_wordinfo.h b/core/fpdfdoc/cpvt_wordinfo.h index c690e2aa7b..3bb452a005 100644 --- a/core/fpdfdoc/cpvt_wordinfo.h +++ b/core/fpdfdoc/cpvt_wordinfo.h @@ -9,7 +9,7 @@ #include -#include "core/fpdfdoc/include/cpvt_wordprops.h" +#include "core/fpdfdoc/cpvt_wordprops.h" #include "core/fxcrt/include/fx_system.h" struct CPVT_WordInfo { diff --git a/core/fpdfdoc/cpvt_wordplace.h b/core/fpdfdoc/cpvt_wordplace.h new file mode 100644 index 0000000000..33ba7c9ce1 --- /dev/null +++ b/core/fpdfdoc/cpvt_wordplace.h @@ -0,0 +1,73 @@ +// 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_FPDFDOC_CPVT_WORDPLACE_H_ +#define CORE_FPDFDOC_CPVT_WORDPLACE_H_ + +#include "core/fxcrt/include/fx_system.h" + +struct CPVT_WordPlace { + CPVT_WordPlace() : nSecIndex(-1), nLineIndex(-1), nWordIndex(-1) {} + + CPVT_WordPlace(int32_t other_nSecIndex, + int32_t other_nLineIndex, + int32_t other_nWordIndex) { + nSecIndex = other_nSecIndex; + nLineIndex = other_nLineIndex; + nWordIndex = other_nWordIndex; + } + + void Default() { nSecIndex = nLineIndex = nWordIndex = -1; } + + bool operator==(const CPVT_WordPlace& wp) const { + return wp.nSecIndex == nSecIndex && wp.nLineIndex == nLineIndex && + wp.nWordIndex == nWordIndex; + } + + FX_BOOL operator!=(const CPVT_WordPlace& wp) const { return !(*this == wp); } + + inline int32_t WordCmp(const CPVT_WordPlace& wp) const { + if (nSecIndex > wp.nSecIndex) + return 1; + if (nSecIndex < wp.nSecIndex) + return -1; + if (nLineIndex > wp.nLineIndex) + return 1; + if (nLineIndex < wp.nLineIndex) + return -1; + if (nWordIndex > wp.nWordIndex) + return 1; + if (nWordIndex < wp.nWordIndex) + return -1; + return 0; + } + + inline int32_t LineCmp(const CPVT_WordPlace& wp) const { + if (nSecIndex > wp.nSecIndex) + return 1; + if (nSecIndex < wp.nSecIndex) + return -1; + if (nLineIndex > wp.nLineIndex) + return 1; + if (nLineIndex < wp.nLineIndex) + return -1; + return 0; + } + + inline int32_t SecCmp(const CPVT_WordPlace& wp) const { + if (nSecIndex > wp.nSecIndex) + return 1; + if (nSecIndex < wp.nSecIndex) + return -1; + return 0; + } + + int32_t nSecIndex; + int32_t nLineIndex; + int32_t nWordIndex; +}; + +#endif // CORE_FPDFDOC_CPVT_WORDPLACE_H_ diff --git a/core/fpdfdoc/cpvt_wordprops.h b/core/fpdfdoc/cpvt_wordprops.h new file mode 100644 index 0000000000..25d8d76f00 --- /dev/null +++ b/core/fpdfdoc/cpvt_wordprops.h @@ -0,0 +1,58 @@ +// 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_FPDFDOC_CPVT_WORDPROPS_H_ +#define CORE_FPDFDOC_CPVT_WORDPROPS_H_ + +#include "core/fpdfdoc/cpdf_variabletext.h" +#include "core/fxcrt/include/fx_system.h" +#include "core/fxge/include/fx_dib.h" + +struct CPVT_WordProps { + CPVT_WordProps() + : nFontIndex(-1), + fFontSize(0.0f), + dwWordColor(0), + nScriptType(CPDF_VariableText::ScriptType::Normal), + nWordStyle(0), + fCharSpace(0.0f), + nHorzScale(0) {} + + CPVT_WordProps(int32_t fontIndex, + FX_FLOAT fontSize, + FX_COLORREF wordColor = 0, + CPDF_VariableText::ScriptType scriptType = + CPDF_VariableText::ScriptType::Normal, + int32_t wordStyle = 0, + FX_FLOAT charSpace = 0, + int32_t horzScale = 100) + : nFontIndex(fontIndex), + fFontSize(fontSize), + dwWordColor(wordColor), + nScriptType(scriptType), + nWordStyle(wordStyle), + fCharSpace(charSpace), + nHorzScale(horzScale) {} + + CPVT_WordProps(const CPVT_WordProps& other) + : nFontIndex(other.nFontIndex), + fFontSize(other.fFontSize), + dwWordColor(other.dwWordColor), + nScriptType(other.nScriptType), + nWordStyle(other.nWordStyle), + fCharSpace(other.fCharSpace), + nHorzScale(other.nHorzScale) {} + + int32_t nFontIndex; + FX_FLOAT fFontSize; + FX_COLORREF dwWordColor; + CPDF_VariableText::ScriptType nScriptType; + int32_t nWordStyle; + FX_FLOAT fCharSpace; + int32_t nHorzScale; +}; + +#endif // CORE_FPDFDOC_CPVT_WORDPROPS_H_ diff --git a/core/fpdfdoc/cpvt_wordrange.h b/core/fpdfdoc/cpvt_wordrange.h new file mode 100644 index 0000000000..3cd0ecfb99 --- /dev/null +++ b/core/fpdfdoc/cpvt_wordrange.h @@ -0,0 +1,59 @@ +// 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_FPDFDOC_CPVT_WORDRANGE_H_ +#define CORE_FPDFDOC_CPVT_WORDRANGE_H_ + +#include "core/fpdfdoc/cpvt_wordplace.h" +#include "core/fxcrt/include/fx_system.h" + +struct CPVT_WordRange { + CPVT_WordRange() {} + + CPVT_WordRange(const CPVT_WordPlace& begin, const CPVT_WordPlace& end) { + Set(begin, end); + } + + void Default() { + BeginPos.Default(); + EndPos.Default(); + } + + void Set(const CPVT_WordPlace& begin, const CPVT_WordPlace& end) { + BeginPos = begin; + EndPos = end; + SwapWordPlace(); + } + + void SetBeginPos(const CPVT_WordPlace& begin) { + BeginPos = begin; + SwapWordPlace(); + } + + void SetEndPos(const CPVT_WordPlace& end) { + EndPos = end; + SwapWordPlace(); + } + + FX_BOOL IsExist() const { return BeginPos != EndPos; } + + FX_BOOL operator!=(const CPVT_WordRange& wr) const { + return wr.BeginPos != BeginPos || wr.EndPos != EndPos; + } + + void SwapWordPlace() { + if (BeginPos.WordCmp(EndPos) > 0) { + CPVT_WordPlace place = EndPos; + EndPos = BeginPos; + BeginPos = place; + } + } + + CPVT_WordPlace BeginPos; + CPVT_WordPlace EndPos; +}; + +#endif // CORE_FPDFDOC_CPVT_WORDRANGE_H_ diff --git a/core/fpdfdoc/doc_tagged.cpp b/core/fpdfdoc/doc_tagged.cpp index a0ce472270..551732d836 100644 --- a/core/fpdfdoc/doc_tagged.cpp +++ b/core/fpdfdoc/doc_tagged.cpp @@ -12,7 +12,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_reference.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" #include "core/fpdfdoc/cpdf_numbertree.h" -#include "core/fpdfdoc/include/fpdf_tagged.h" +#include "core/fpdfdoc/fpdf_tagged.h" #include "core/fpdfdoc/tagged_int.h" namespace { diff --git a/core/fpdfdoc/fpdf_tagged.h b/core/fpdfdoc/fpdf_tagged.h new file mode 100644 index 0000000000..da05b79674 --- /dev/null +++ b/core/fpdfdoc/fpdf_tagged.h @@ -0,0 +1,93 @@ +// Copyright 2014 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_FPDFDOC_FPDF_TAGGED_H_ +#define CORE_FPDFDOC_FPDF_TAGGED_H_ + +#include "core/fxge/include/fx_dib.h" + +class CPDF_Dictionary; +class CPDF_Document; +class IPDF_StructElement; + +class IPDF_StructTree { + public: + static IPDF_StructTree* LoadDoc(const CPDF_Document* pDoc); + static IPDF_StructTree* LoadPage(const CPDF_Document* pDoc, + const CPDF_Dictionary* pPageDict); + + virtual ~IPDF_StructTree() {} + + virtual int CountTopElements() const = 0; + virtual IPDF_StructElement* GetTopElement(int i) const = 0; +}; + +struct CPDF_StructKid { + enum { Invalid, Element, PageContent, StreamContent, Object } m_Type; + + union { + struct { + IPDF_StructElement* m_pElement; + CPDF_Dictionary* m_pDict; + } m_Element; + struct { + uint32_t m_PageObjNum; + uint32_t m_ContentId; + } m_PageContent; + struct { + uint32_t m_PageObjNum; + uint32_t m_ContentId; + uint32_t m_RefObjNum; + } m_StreamContent; + struct { + uint32_t m_PageObjNum; + uint32_t m_RefObjNum; + } m_Object; + }; +}; + +class IPDF_StructElement { + public: + virtual ~IPDF_StructElement() {} + + virtual IPDF_StructTree* GetTree() const = 0; + virtual const CFX_ByteString& GetType() const = 0; + virtual IPDF_StructElement* GetParent() const = 0; + virtual CPDF_Dictionary* GetDict() const = 0; + virtual int CountKids() const = 0; + virtual const CPDF_StructKid& GetKid(int index) const = 0; + + virtual CPDF_Object* GetAttr(const CFX_ByteStringC& owner, + const CFX_ByteStringC& name, + FX_BOOL bInheritable = FALSE, + FX_FLOAT fLevel = 0.0F) = 0; + + virtual CFX_ByteString GetName(const CFX_ByteStringC& owner, + const CFX_ByteStringC& name, + const CFX_ByteStringC& default_value, + FX_BOOL bInheritable = FALSE, + int subindex = -1) = 0; + + virtual FX_ARGB GetColor(const CFX_ByteStringC& owner, + const CFX_ByteStringC& name, + FX_ARGB default_value, + FX_BOOL bInheritable = FALSE, + int subindex = -1) = 0; + + virtual FX_FLOAT GetNumber(const CFX_ByteStringC& owner, + const CFX_ByteStringC& name, + FX_FLOAT default_value, + FX_BOOL bInheritable = FALSE, + int subindex = -1) = 0; + + virtual int GetInteger(const CFX_ByteStringC& owner, + const CFX_ByteStringC& name, + int default_value, + FX_BOOL bInheritable = FALSE, + int subindex = -1) = 0; +}; + +#endif // CORE_FPDFDOC_FPDF_TAGGED_H_ diff --git a/core/fpdfdoc/include/cpdf_aaction.h b/core/fpdfdoc/include/cpdf_aaction.h deleted file mode 100644 index b3a55da23e..0000000000 --- a/core/fpdfdoc/include/cpdf_aaction.h +++ /dev/null @@ -1,51 +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_FPDFDOC_INCLUDE_CPDF_AACTION_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_AACTION_H_ - -#include "core/fpdfdoc/include/cpdf_action.h" - -class CPDF_Dictionary; - -class CPDF_AAction { - public: - enum AActionType { - CursorEnter = 0, - CursorExit, - ButtonDown, - ButtonUp, - GetFocus, - LoseFocus, - PageOpen, - PageClose, - PageVisible, - PageInvisible, - OpenPage, - ClosePage, - KeyStroke, - Format, - Validate, - Calculate, - CloseDocument, - SaveDocument, - DocumentSaved, - PrintDocument, - DocumentPrinted - }; - - CPDF_AAction() : m_pDict(nullptr) {} - explicit CPDF_AAction(CPDF_Dictionary* pDict) : m_pDict(pDict) {} - - FX_BOOL ActionExist(AActionType eType) const; - CPDF_Action GetAction(AActionType eType) const; - CPDF_Dictionary* GetDict() const { return m_pDict; } - - private: - CPDF_Dictionary* const m_pDict; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_AACTION_H_ diff --git a/core/fpdfdoc/include/cpdf_action.h b/core/fpdfdoc/include/cpdf_action.h deleted file mode 100644 index 209f1f9f09..0000000000 --- a/core/fpdfdoc/include/cpdf_action.h +++ /dev/null @@ -1,59 +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_FPDFDOC_INCLUDE_CPDF_ACTION_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_ACTION_H_ - -#include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" -#include "core/fpdfdoc/include/cpdf_dest.h" -#include "core/fxcrt/include/fx_string.h" - -class CPDF_Document; - -class CPDF_Action { - public: - enum ActionType { - Unknown = 0, - GoTo, - GoToR, - GoToE, - Launch, - Thread, - URI, - Sound, - Movie, - Hide, - Named, - SubmitForm, - ResetForm, - ImportData, - JavaScript, - SetOCGState, - Rendition, - Trans, - GoTo3DView - }; - - CPDF_Action() : m_pDict(nullptr) {} - explicit CPDF_Action(CPDF_Dictionary* pDict) : m_pDict(pDict) {} - - CPDF_Dictionary* GetDict() const { return m_pDict; } - ActionType GetType() const; - CPDF_Dest GetDest(CPDF_Document* pDoc) const; - CFX_WideString GetFilePath() const; - CFX_ByteString GetURI(CPDF_Document* pDoc) const; - bool GetHideStatus() const { return m_pDict->GetBooleanFor("H", true); } - CFX_ByteString GetNamedAction() const { return m_pDict->GetStringFor("N"); } - uint32_t GetFlags() const { return m_pDict->GetIntegerFor("Flags"); } - CFX_WideString GetJavaScript() const; - size_t GetSubActionsCount() const; - CPDF_Action GetSubAction(size_t iIndex) const; - - private: - CPDF_Dictionary* const m_pDict; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_ACTION_H_ diff --git a/core/fpdfdoc/include/cpdf_actionfields.h b/core/fpdfdoc/include/cpdf_actionfields.h deleted file mode 100644 index 0f38e1d469..0000000000 --- a/core/fpdfdoc/include/cpdf_actionfields.h +++ /dev/null @@ -1,29 +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_FPDFDOC_INCLUDE_CPDF_ACTIONFIELDS_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_ACTIONFIELDS_H_ - -#include - -#include - -class CPDF_Action; -class CPDF_Object; - -class CPDF_ActionFields { - public: - explicit CPDF_ActionFields(const CPDF_Action* pAction) : m_pAction(pAction) {} - - size_t GetFieldsCount() const; - std::vector GetAllFields() const; - CPDF_Object* GetField(size_t iIndex) const; - - private: - const CPDF_Action* const m_pAction; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_ACTIONFIELDS_H_ diff --git a/core/fpdfdoc/include/cpdf_annot.h b/core/fpdfdoc/include/cpdf_annot.h deleted file mode 100644 index e88375a903..0000000000 --- a/core/fpdfdoc/include/cpdf_annot.h +++ /dev/null @@ -1,131 +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_FPDFDOC_INCLUDE_CPDF_ANNOT_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_ - -#include -#include - -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_string.h" -#include "core/fxcrt/include/fx_system.h" - -class CFX_RenderDevice; -class CPDF_Dictionary; -class CPDF_Document; -class CPDF_Form; -class CPDF_Page; -class CPDF_RenderContext; -class CPDF_RenderOptions; -class CPDF_Stream; - -#define ANNOTFLAG_INVISIBLE 0x0001 -#define ANNOTFLAG_HIDDEN 0x0002 -#define ANNOTFLAG_PRINT 0x0004 -#define ANNOTFLAG_NOZOOM 0x0008 -#define ANNOTFLAG_NOROTATE 0x0010 -#define ANNOTFLAG_NOVIEW 0x0020 -#define ANNOTFLAG_READONLY 0x0040 -#define ANNOTFLAG_LOCKED 0x0080 -#define ANNOTFLAG_TOGGLENOVIEW 0x0100 - -class CPDF_Annot { - public: - enum AppearanceMode { Normal, Rollover, Down }; - enum class Subtype { - UNKNOWN = 0, - TEXT, - LINK, - FREETEXT, - LINE, - SQUARE, - CIRCLE, - POLYGON, - POLYLINE, - HIGHLIGHT, - UNDERLINE, - SQUIGGLY, - STRIKEOUT, - STAMP, - CARET, - INK, - POPUP, - FILEATTACHMENT, - SOUND, - MOVIE, - WIDGET, - SCREEN, - PRINTERMARK, - TRAPNET, - WATERMARK, - THREED, - RICHMEDIA, - XFAWIDGET - }; - - static bool IsAnnotationHidden(CPDF_Dictionary* pAnnotDict); - static CPDF_Annot::Subtype StringToAnnotSubtype( - const CFX_ByteString& sSubtype); - static CFX_ByteString AnnotSubtypeToString(CPDF_Annot::Subtype nSubtype); - static CFX_FloatRect RectFromQuadPoints(CPDF_Dictionary* pAnnotDict); - - CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument, bool bToOwnDict); - ~CPDF_Annot(); - - CPDF_Annot::Subtype GetSubtype() const; - uint32_t GetFlags() const; - CFX_FloatRect GetRect() const; - const CPDF_Dictionary* GetAnnotDict() const { return m_pAnnotDict; } - CPDF_Dictionary* GetAnnotDict() { return m_pAnnotDict; } - CPDF_Document* GetDocument() const { return m_pDocument; } - - FX_BOOL DrawAppearance(CPDF_Page* pPage, - CFX_RenderDevice* pDevice, - const CFX_Matrix* pUser2Device, - AppearanceMode mode, - const CPDF_RenderOptions* pOptions); - FX_BOOL DrawInContext(const CPDF_Page* pPage, - CPDF_RenderContext* pContext, - const CFX_Matrix* pUser2Device, - AppearanceMode mode); - - void ClearCachedAP(); - void DrawBorder(CFX_RenderDevice* pDevice, - const CFX_Matrix* pUser2Device, - const CPDF_RenderOptions* pOptions); - CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode); - void SetOpenState(bool bOpenState) { m_bOpenState = bOpenState; } - CPDF_Annot* GetPopupAnnot() const { return m_pPopupAnnot; } - void SetPopupAnnot(CPDF_Annot* pAnnot) { m_pPopupAnnot = pAnnot; } - - private: - void GenerateAPIfNeeded(); - bool ShouldDrawAnnotation(); - - CFX_FloatRect RectForDrawing() const; - - // For regular annotations, |m_pAnnotDict| is not owned. For - // our artificially created popup annotations, |m_pAnnotDict| - // is owned by this class. - bool m_bOwnedAnnotDict; - CPDF_Dictionary* m_pAnnotDict; - CPDF_Document* const m_pDocument; - CPDF_Annot::Subtype m_nSubtype; - std::map> m_APMap; - // |m_bOpenState| is only set for popup annotations. - bool m_bOpenState; - bool m_bHasGeneratedAP; - bool m_bIsTextMarkupAnnotation; - // Not owned. If there is a valid pointer in |m_pPopupAnnot|, - // then this annot is never a popup. - CPDF_Annot* m_pPopupAnnot; -}; - -CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, - CPDF_Annot::AppearanceMode mode); - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_ diff --git a/core/fpdfdoc/include/cpdf_annotlist.h b/core/fpdfdoc/include/cpdf_annotlist.h deleted file mode 100644 index f76ec64cd9..0000000000 --- a/core/fpdfdoc/include/cpdf_annotlist.h +++ /dev/null @@ -1,64 +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_FPDFDOC_INCLUDE_CPDF_ANNOTLIST_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_ANNOTLIST_H_ - -#include -#include - -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_system.h" - -class CFX_RenderDevice; -class CPDF_Annot; -class CPDF_Document; -class CPDF_Page; -class CPDF_RenderContext; -class CPDF_RenderOptions; - -class CPDF_AnnotList { - public: - explicit CPDF_AnnotList(CPDF_Page* pPage); - ~CPDF_AnnotList(); - - void DisplayAnnots(CPDF_Page* pPage, - CPDF_RenderContext* pContext, - FX_BOOL bPrinting, - CFX_Matrix* pMatrix, - FX_BOOL bShowWidget, - CPDF_RenderOptions* pOptions); - - void DisplayAnnots(CPDF_Page* pPage, - CFX_RenderDevice* pDevice, - CPDF_RenderContext* pContext, - FX_BOOL bPrinting, - CFX_Matrix* pMatrix, - uint32_t dwAnnotFlags, - CPDF_RenderOptions* pOptions, - FX_RECT* pClipRect); - - size_t Count() const { return m_AnnotList.size(); } - CPDF_Annot* GetAt(size_t index) const { return m_AnnotList[index].get(); } - const std::vector>& All() const { - return m_AnnotList; - } - - private: - void DisplayPass(CPDF_Page* pPage, - CFX_RenderDevice* pDevice, - CPDF_RenderContext* pContext, - FX_BOOL bPrinting, - CFX_Matrix* pMatrix, - FX_BOOL bWidget, - CPDF_RenderOptions* pOptions, - FX_RECT* clip_rect); - - CPDF_Document* const m_pDocument; - std::vector> m_AnnotList; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_ANNOTLIST_H_ diff --git a/core/fpdfdoc/include/cpdf_bookmark.h b/core/fpdfdoc/include/cpdf_bookmark.h deleted file mode 100644 index ba0b059572..0000000000 --- a/core/fpdfdoc/include/cpdf_bookmark.h +++ /dev/null @@ -1,33 +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_FPDFDOC_INCLUDE_CPDF_BOOKMARK_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_BOOKMARK_H_ - -#include "core/fpdfdoc/include/cpdf_action.h" -#include "core/fpdfdoc/include/cpdf_dest.h" -#include "core/fxcrt/include/fx_string.h" - -class CPDF_Dictionary; -class CPDF_Document; - -class CPDF_Bookmark { - public: - CPDF_Bookmark() : m_pDict(nullptr) {} - explicit CPDF_Bookmark(CPDF_Dictionary* pDict) : m_pDict(pDict) {} - - CPDF_Dictionary* GetDict() const { return m_pDict; } - uint32_t GetColorRef() const; - uint32_t GetFontStyle() const; - CFX_WideString GetTitle() const; - CPDF_Dest GetDest(CPDF_Document* pDocument) const; - CPDF_Action GetAction() const; - - private: - CPDF_Dictionary* m_pDict; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_BOOKMARK_H_ diff --git a/core/fpdfdoc/include/cpdf_bookmarktree.h b/core/fpdfdoc/include/cpdf_bookmarktree.h deleted file mode 100644 index f496053383..0000000000 --- a/core/fpdfdoc/include/cpdf_bookmarktree.h +++ /dev/null @@ -1,26 +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_FPDFDOC_INCLUDE_CPDF_BOOKMARKTREE_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_BOOKMARKTREE_H_ - -#include "core/fpdfdoc/include/cpdf_bookmark.h" - -class CPDF_Document; - -class CPDF_BookmarkTree { - public: - explicit CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {} - - CPDF_Bookmark GetFirstChild(const CPDF_Bookmark& parent) const; - CPDF_Bookmark GetNextSibling(const CPDF_Bookmark& bookmark) const; - CPDF_Document* GetDocument() const { return m_pDocument; } - - private: - CPDF_Document* const m_pDocument; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_BOOKMARKTREE_H_ diff --git a/core/fpdfdoc/include/cpdf_defaultappearance.h b/core/fpdfdoc/include/cpdf_defaultappearance.h deleted file mode 100644 index c0fd3de709..0000000000 --- a/core/fpdfdoc/include/cpdf_defaultappearance.h +++ /dev/null @@ -1,52 +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_FPDFDOC_INCLUDE_CPDF_DEFAULTAPPEARANCE_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_DEFAULTAPPEARANCE_H_ - -#include "core/fpdfdoc/include/cpdf_defaultappearance.h" -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_string.h" -#include "core/fxcrt/include/fx_system.h" -#include "core/fxge/include/fx_dib.h" - -enum class BorderStyle { SOLID, DASH, BEVELED, INSET, UNDERLINE }; -enum class PaintOperation { STROKE, FILL }; - -class CPDF_DefaultAppearance { - public: - CPDF_DefaultAppearance() {} - explicit CPDF_DefaultAppearance(const CFX_ByteString& csDA) : m_csDA(csDA) {} - - CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) { - m_csDA = cDA.GetStr(); - } - - CFX_ByteString GetStr() const { return m_csDA; } - - FX_BOOL HasFont(); - CFX_ByteString GetFontString(); - void GetFont(CFX_ByteString& csFontNameTag, FX_FLOAT& fFontSize); - - FX_BOOL HasColor(PaintOperation nOperation = PaintOperation::FILL); - CFX_ByteString GetColorString( - PaintOperation nOperation = PaintOperation::FILL); - void GetColor(int& iColorType, - FX_FLOAT fc[4], - PaintOperation nOperation = PaintOperation::FILL); - void GetColor(FX_ARGB& color, - int& iColorType, - PaintOperation nOperation = PaintOperation::FILL); - - FX_BOOL HasTextMatrix(); - CFX_ByteString GetTextMatrixString(); - CFX_Matrix GetTextMatrix(); - - private: - CFX_ByteString m_csDA; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_DEFAULTAPPEARANCE_H_ diff --git a/core/fpdfdoc/include/cpdf_dest.h b/core/fpdfdoc/include/cpdf_dest.h deleted file mode 100644 index 82d8a2b5cf..0000000000 --- a/core/fpdfdoc/include/cpdf_dest.h +++ /dev/null @@ -1,32 +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_FPDFDOC_INCLUDE_CPDF_DEST_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_DEST_H_ - -#include "core/fxcrt/include/fx_string.h" -#include "core/fxcrt/include/fx_system.h" - -class CPDF_Document; -class CPDF_Object; - -class CPDF_Dest { - public: - CPDF_Dest() : m_pObj(nullptr) {} - explicit CPDF_Dest(CPDF_Object* pObj) : m_pObj(pObj) {} - - CPDF_Object* GetObject() const { return m_pObj; } - CFX_ByteString GetRemoteName(); - int GetPageIndex(CPDF_Document* pDoc); - uint32_t GetPageObjNum(); - int GetZoomMode(); - FX_FLOAT GetParam(int index); - - private: - CPDF_Object* m_pObj; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_DEST_H_ diff --git a/core/fpdfdoc/include/cpdf_docjsactions.h b/core/fpdfdoc/include/cpdf_docjsactions.h deleted file mode 100644 index 137b6afd53..0000000000 --- a/core/fpdfdoc/include/cpdf_docjsactions.h +++ /dev/null @@ -1,29 +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_FPDFDOC_INCLUDE_CPDF_DOCJSACTIONS_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_DOCJSACTIONS_H_ - -#include "core/fpdfdoc/include/cpdf_action.h" -#include "core/fxcrt/include/fx_string.h" - -class CPDF_Document; - -class CPDF_DocJSActions { - public: - explicit CPDF_DocJSActions(CPDF_Document* pDoc); - - int CountJSActions() const; - CPDF_Action GetJSAction(int index, CFX_ByteString& csName) const; - CPDF_Action GetJSAction(const CFX_ByteString& csName) const; - int FindJSAction(const CFX_ByteString& csName) const; - CPDF_Document* GetDocument() const { return m_pDocument; } - - private: - CPDF_Document* const m_pDocument; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_DOCJSACTIONS_H_ diff --git a/core/fpdfdoc/include/cpdf_filespec.h b/core/fpdfdoc/include/cpdf_filespec.h deleted file mode 100644 index 66f35fc202..0000000000 --- a/core/fpdfdoc/include/cpdf_filespec.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_FPDFDOC_INCLUDE_CPDF_FILESPEC_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_FILESPEC_H_ - -#include "core/fxcrt/include/cfx_string_pool_template.h" -#include "core/fxcrt/include/cfx_weak_ptr.h" -#include "core/fxcrt/include/fx_string.h" - -class CPDF_Object; - -class CPDF_FileSpec { - public: - explicit CPDF_FileSpec(const CFX_WeakPtr& pPool); - explicit CPDF_FileSpec(CPDF_Object* pObj) : m_pObj(pObj) {} - - // Convert a platform dependent file name into pdf format. - static CFX_WideString EncodeFileName(const CFX_WideStringC& filepath); - - // Convert a pdf file name into platform dependent format. - static CFX_WideString DecodeFileName(const CFX_WideStringC& filepath); - - CPDF_Object* GetObj() const { return m_pObj; } - bool GetFileName(CFX_WideString* wsFileName) const; - - // Set this file spec to refer to a file name (not a url). - void SetFileName(const CFX_WideStringC& wsFileName); - - private: - CPDF_Object* m_pObj; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_FILESPEC_H_ diff --git a/core/fpdfdoc/include/cpdf_formcontrol.h b/core/fpdfdoc/include/cpdf_formcontrol.h deleted file mode 100644 index c73318f49e..0000000000 --- a/core/fpdfdoc/include/cpdf_formcontrol.h +++ /dev/null @@ -1,134 +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_FPDFDOC_INCLUDE_CPDF_FORMCONTROL_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_FORMCONTROL_H_ - -#include "core/fpdfdoc/cpdf_apsettings.h" -#include "core/fpdfdoc/include/cpdf_aaction.h" -#include "core/fpdfdoc/include/cpdf_action.h" -#include "core/fpdfdoc/include/cpdf_annot.h" -#include "core/fpdfdoc/include/cpdf_annotlist.h" -#include "core/fpdfdoc/include/cpdf_defaultappearance.h" -#include "core/fpdfdoc/include/cpdf_formfield.h" -#include "core/fpdfdoc/include/cpdf_iconfit.h" -#include "core/fpdfdoc/include/ipdf_formnotify.h" -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_string.h" -#include "core/fxge/include/fx_dib.h" - -#define TEXTPOS_CAPTION 0 -#define TEXTPOS_ICON 1 -#define TEXTPOS_BELOW 2 -#define TEXTPOS_ABOVE 3 -#define TEXTPOS_RIGHT 4 -#define TEXTPOS_LEFT 5 -#define TEXTPOS_OVERLAID 6 - -#define COLORTYPE_TRANSPARENT 0 -#define COLORTYPE_GRAY 1 -#define COLORTYPE_RGB 2 -#define COLORTYPE_CMYK 3 - -class CFX_RenderDevice; -class CPDF_Dictionary; -class CPDF_Font; -class CPDF_FormField; -class CPDF_InterForm; -class CPDF_OCContext; -class CPDF_RenderOptions; -class CPDF_Stream; - -class CPDF_FormControl { - public: - enum HighlightingMode { None = 0, Invert, Outline, Push, Toggle }; - - CPDF_FormField::Type GetType() const { return m_pField->GetType(); } - CPDF_InterForm* GetInterForm() const { return m_pForm; } - CPDF_FormField* GetField() const { return m_pField; } - CPDF_Dictionary* GetWidget() const { return m_pWidgetDict; } - CFX_FloatRect GetRect() const { return m_pWidgetDict->GetRectFor("Rect"); } - - void DrawControl(CFX_RenderDevice* pDevice, - CFX_Matrix* pMatrix, - CPDF_Page* pPage, - CPDF_Annot::AppearanceMode mode, - const CPDF_RenderOptions* pOptions = nullptr); - - CFX_ByteString GetCheckedAPState(); - CFX_WideString GetExportValue() const; - - bool IsChecked() const; - bool IsDefaultChecked() const; - - HighlightingMode GetHighlightingMode(); - bool HasMKEntry(const CFX_ByteString& csEntry) const; - int GetRotation(); - - FX_ARGB GetBorderColor(int& iColorType) { return GetColor(iColorType, "BC"); } - - FX_FLOAT GetOriginalBorderColor(int index) { - return GetOriginalColor(index, "BC"); - } - - void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4]) { - GetOriginalColor(iColorType, fc, "BC"); - } - - FX_ARGB GetBackgroundColor(int& iColorType) { - return GetColor(iColorType, "BG"); - } - - FX_FLOAT GetOriginalBackgroundColor(int index) { - return GetOriginalColor(index, "BG"); - } - - void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4]) { - GetOriginalColor(iColorType, fc, "BG"); - } - - CFX_WideString GetNormalCaption() { return GetCaption("CA"); } - CFX_WideString GetRolloverCaption() { return GetCaption("RC"); } - CFX_WideString GetDownCaption() { return GetCaption("AC"); } - - CPDF_Stream* GetNormalIcon() { return GetIcon("I"); } - CPDF_Stream* GetRolloverIcon() { return GetIcon("RI"); } - CPDF_Stream* GetDownIcon() { return GetIcon("IX"); } - CPDF_IconFit GetIconFit(); - - int GetTextPosition(); - CPDF_Action GetAction(); - CPDF_AAction GetAdditionalAction(); - CPDF_DefaultAppearance GetDefaultAppearance(); - - CPDF_Font* GetDefaultControlFont(); - int GetControlAlignment(); - - private: - friend class CPDF_InterForm; - friend class CPDF_FormField; - - CPDF_FormControl(CPDF_FormField* pField, CPDF_Dictionary* pWidgetDict); - - CFX_ByteString GetOnStateName() const; - void SetOnStateName(const CFX_ByteString& csOn); - void CheckControl(FX_BOOL bChecked); - FX_ARGB GetColor(int& iColorType, const CFX_ByteString& csEntry); - FX_FLOAT GetOriginalColor(int index, const CFX_ByteString& csEntry); - void GetOriginalColor(int& iColorType, - FX_FLOAT fc[4], - const CFX_ByteString& csEntry); - - CFX_WideString GetCaption(const CFX_ByteString& csEntry); - CPDF_Stream* GetIcon(const CFX_ByteString& csEntry); - CPDF_ApSettings GetMK() const; - - CPDF_FormField* const m_pField; - CPDF_Dictionary* const m_pWidgetDict; - CPDF_InterForm* const m_pForm; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_FORMCONTROL_H_ diff --git a/core/fpdfdoc/include/cpdf_formfield.h b/core/fpdfdoc/include/cpdf_formfield.h deleted file mode 100644 index d39c6da4d4..0000000000 --- a/core/fpdfdoc/include/cpdf_formfield.h +++ /dev/null @@ -1,168 +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_FPDFDOC_INCLUDE_CPDF_FORMFIELD_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_FORMFIELD_H_ - -#include "core/fpdfdoc/include/cpdf_aaction.h" -#include "core/fpdfdoc/include/cpdf_formfield.h" -#include "core/fxcrt/include/fx_basic.h" -#include "core/fxcrt/include/fx_string.h" -#include "core/fxcrt/include/fx_system.h" - -#define FIELDTYPE_UNKNOWN 0 -#define FIELDTYPE_PUSHBUTTON 1 -#define FIELDTYPE_CHECKBOX 2 -#define FIELDTYPE_RADIOBUTTON 3 -#define FIELDTYPE_COMBOBOX 4 -#define FIELDTYPE_LISTBOX 5 -#define FIELDTYPE_TEXTFIELD 6 -#define FIELDTYPE_SIGNATURE 7 - -class CPDF_Dictionary; -class CPDF_Font; -class CPDF_FormControl; -class CPDF_InterForm; -class CPDF_String; - -CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, - const FX_CHAR* name, - int nLevel = 0); -CFX_WideString FPDF_GetFullName(CPDF_Dictionary* pFieldDict); - -class CPDF_FormField { - public: - enum Type { - Unknown, - PushButton, - RadioButton, - CheckBox, - Text, - RichText, - File, - ListBox, - ComboBox, - Sign - }; - - CFX_WideString GetFullName() const; - - Type GetType() const { return m_Type; } - uint32_t GetFlags() const { return m_Flags; } - - CPDF_Dictionary* GetFieldDict() const { return m_pDict; } - void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; } - - FX_BOOL ResetField(FX_BOOL bNotify = FALSE); - - int CountControls() const { return m_ControlList.GetSize(); } - - CPDF_FormControl* GetControl(int index) const { - return m_ControlList.GetAt(index); - } - - int GetControlIndex(const CPDF_FormControl* pControl) const; - int GetFieldType() const; - - CPDF_AAction GetAdditionalAction() const; - CFX_WideString GetAlternateName() const; - CFX_WideString GetMappingName() const; - - uint32_t GetFieldFlags() const; - CFX_ByteString GetDefaultStyle() const; - CFX_WideString GetRichTextString() const; - - CFX_WideString GetValue() const; - CFX_WideString GetDefaultValue() const; - FX_BOOL SetValue(const CFX_WideString& value, FX_BOOL bNotify = FALSE); - - int GetMaxLen() const; - int CountSelectedItems() const; - int GetSelectedIndex(int index) const; - - FX_BOOL ClearSelection(FX_BOOL bNotify = FALSE); - FX_BOOL IsItemSelected(int index) const; - FX_BOOL SetItemSelection(int index, - FX_BOOL bSelected, - FX_BOOL bNotify = FALSE); - - FX_BOOL IsItemDefaultSelected(int index) const; - - int GetDefaultSelectedItem() const; - int CountOptions() const; - - CFX_WideString GetOptionLabel(int index) const; - CFX_WideString GetOptionValue(int index) const; - - int FindOption(CFX_WideString csOptLabel) const; - int FindOptionValue(const CFX_WideString& csOptValue) const; - - FX_BOOL CheckControl(int iControlIndex, bool bChecked, bool bNotify = false); - - int GetTopVisibleIndex() const; - int CountSelectedOptions() const; - - int GetSelectedOptionIndex(int index) const; - FX_BOOL IsOptionSelected(int iOptIndex) const; - - FX_BOOL SelectOption(int iOptIndex, - FX_BOOL bSelected, - FX_BOOL bNotify = FALSE); - - FX_BOOL ClearSelectedOptions(FX_BOOL bNotify = FALSE); - -#ifdef PDF_ENABLE_XFA - FX_BOOL ClearOptions(FX_BOOL bNotify = FALSE); - - int InsertOption(CFX_WideString csOptLabel, - int index = -1, - FX_BOOL bNotify = FALSE); -#endif // PDF_ENABLE_XFA - - FX_FLOAT GetFontSize() const { return m_FontSize; } - CPDF_Font* GetFont() const { return m_pFont; } - - private: - friend class CPDF_InterForm; - friend class CPDF_FormControl; - - CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict); - ~CPDF_FormField(); - - CFX_WideString GetValue(FX_BOOL bDefault) const; - FX_BOOL SetValue(const CFX_WideString& value, - FX_BOOL bDefault, - FX_BOOL bNotify); - - void SyncFieldFlags(); - int FindListSel(CPDF_String* str); - CFX_WideString GetOptionText(int index, int sub_index) const; - - void LoadDA(); - CFX_WideString GetCheckValue(FX_BOOL bDefault) const; - FX_BOOL SetCheckValue(const CFX_WideString& value, - FX_BOOL bDefault, - FX_BOOL bNotify); - - bool NotifyBeforeSelectionChange(const CFX_WideString& value); - void NotifyAfterSelectionChange(); - - bool NotifyBeforeValueChange(const CFX_WideString& value); - void NotifyAfterValueChange(); - - bool NotifyListOrComboBoxBeforeChange(const CFX_WideString& value); - void NotifyListOrComboBoxAfterChange(); - - CPDF_FormField::Type m_Type; - uint32_t m_Flags; - CPDF_InterForm* m_pForm; - CPDF_Dictionary* m_pDict; - CFX_ArrayTemplate m_ControlList; - FX_FLOAT m_FontSize; - CPDF_Font* m_pFont; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_FORMFIELD_H_ diff --git a/core/fpdfdoc/include/cpdf_iconfit.h b/core/fpdfdoc/include/cpdf_iconfit.h deleted file mode 100644 index a13730d8ce..0000000000 --- a/core/fpdfdoc/include/cpdf_iconfit.h +++ /dev/null @@ -1,30 +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_FPDFDOC_INCLUDE_CPDF_ICONFIT_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_ICONFIT_H_ - -#include "core/fxcrt/include/fx_system.h" - -class CPDF_Dictionary; - -class CPDF_IconFit { - public: - enum ScaleMethod { Always = 0, Bigger, Smaller, Never }; - - explicit CPDF_IconFit(const CPDF_Dictionary* pDict) : m_pDict(pDict) {} - - ScaleMethod GetScaleMethod(); - FX_BOOL IsProportionalScale(); - void GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom); - bool GetFittingBounds(); - const CPDF_Dictionary* GetDict() const { return m_pDict; } - - private: - const CPDF_Dictionary* const m_pDict; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_ICONFIT_H_ diff --git a/core/fpdfdoc/include/cpdf_interform.h b/core/fpdfdoc/include/cpdf_interform.h deleted file mode 100644 index c5512d4699..0000000000 --- a/core/fpdfdoc/include/cpdf_interform.h +++ /dev/null @@ -1,119 +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_FPDFDOC_INCLUDE_CPDF_INTERFORM_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_INTERFORM_H_ - -#include -#include -#include - -#include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" -#include "core/fpdfdoc/include/cpdf_defaultappearance.h" -#include "core/fxcrt/include/fx_string.h" -#include "core/fxcrt/include/fx_system.h" - -class CFieldTree; -class CFDF_Document; -class CPDF_Document; -class CPDF_Dictionary; -class CPDF_Font; -class CPDF_FormControl; -class CPDF_FormField; -class CPDF_Object; -class CPDF_Page; -class IPDF_FormNotify; - -CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, - CPDF_Document* pDocument, - CFX_ByteString& csNameTag); - -class CPDF_InterForm { - public: - explicit CPDF_InterForm(CPDF_Document* pDocument); - ~CPDF_InterForm(); - - static void SetUpdateAP(bool bUpdateAP); - static bool IsUpdateAPEnabled(); - static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* pResDict, - const FX_CHAR* csType, - int iMinLen, - const FX_CHAR* csPrefix); - static CPDF_Font* AddStandardFont(CPDF_Document* pDocument, - CFX_ByteString csFontName); - static CFX_ByteString GetNativeFont(uint8_t iCharSet, void* pLogFont); - static uint8_t GetNativeCharSet(); - static CPDF_Font* AddNativeFont(uint8_t iCharSet, CPDF_Document* pDocument); - static CPDF_Font* AddNativeFont(CPDF_Document* pDocument); - - size_t CountFields(const CFX_WideString& csFieldName) const; - CPDF_FormField* GetField(uint32_t index, - const CFX_WideString& csFieldName) const; - CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const; - - CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage, - FX_FLOAT pdf_x, - FX_FLOAT pdf_y, - int* z_order) const; - CPDF_FormControl* GetControlByDict(const CPDF_Dictionary* pWidgetDict) const; - - FX_BOOL NeedConstructAP() const; - int CountFieldsInCalculationOrder(); - CPDF_FormField* GetFieldInCalculationOrder(int index); - int FindFieldInCalculationOrder(const CPDF_FormField* pField); - - CPDF_Font* GetFormFont(CFX_ByteString csNameTag); - CPDF_DefaultAppearance GetDefaultAppearance() const; - int GetFormAlignment() const; - - CPDF_FormField* CheckRequiredFields( - const std::vector* fields, - bool bIncludeOrExclude) const; - - CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, - bool bSimpleFileSpec) const; - CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, - const std::vector& fields, - bool bIncludeOrExclude, - bool bSimpleFileSpec) const; - - bool ResetForm(const std::vector& fields, - bool bIncludeOrExclude, - bool bNotify); - bool ResetForm(bool bNotify); - - void SetFormNotify(IPDF_FormNotify* pNotify); - FX_BOOL HasXFAForm() const; - void FixPageFields(const CPDF_Page* pPage); - - private: - friend class CPDF_FormControl; - friend class CPDF_FormField; - - void LoadField(CPDF_Dictionary* pFieldDict, int nLevel); - CPDF_FormField* AddTerminalField(CPDF_Dictionary* pFieldDict); - CPDF_FormControl* AddControl(CPDF_FormField* pField, - CPDF_Dictionary* pWidgetDict); - void FDF_ImportField(CPDF_Dictionary* pField, - const CFX_WideString& parent_name, - FX_BOOL bNotify = FALSE, - int nLevel = 0); - bool ValidateFieldName(CFX_WideString& csNewFieldName, - int iType, - const CPDF_FormField* pExcludedField, - const CPDF_FormControl* pExcludedControl) const; - - static bool s_bUpdateAP; - - CPDF_Document* const m_pDocument; - CPDF_Dictionary* m_pFormDict; - std::map m_ControlMap; - std::unique_ptr m_pFieldTree; - CFX_ByteString m_bsEncoding; - IPDF_FormNotify* m_pFormNotify; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_INTERFORM_H_ diff --git a/core/fpdfdoc/include/cpdf_link.h b/core/fpdfdoc/include/cpdf_link.h deleted file mode 100644 index a3be3ccc90..0000000000 --- a/core/fpdfdoc/include/cpdf_link.h +++ /dev/null @@ -1,31 +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_FPDFDOC_INCLUDE_CPDF_LINK_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_LINK_H_ - -#include "core/fpdfdoc/include/cpdf_action.h" -#include "core/fpdfdoc/include/cpdf_dest.h" -#include "core/fxcrt/include/fx_coordinates.h" - -class CPDF_Dictionary; - -class CPDF_Link { - public: - CPDF_Link() : m_pDict(nullptr) {} - explicit CPDF_Link(CPDF_Dictionary* pDict) : m_pDict(pDict) {} - - CPDF_Dictionary* GetDict() const { return m_pDict; } - - CFX_FloatRect GetRect(); - CPDF_Dest GetDest(CPDF_Document* pDoc); - CPDF_Action GetAction(); - - private: - CPDF_Dictionary* m_pDict; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_LINK_H_ diff --git a/core/fpdfdoc/include/cpdf_linklist.h b/core/fpdfdoc/include/cpdf_linklist.h deleted file mode 100644 index dd9f5517d4..0000000000 --- a/core/fpdfdoc/include/cpdf_linklist.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_FPDFDOC_INCLUDE_CPDF_LINKLIST_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_LINKLIST_H_ - -#include -#include - -#include "core/fpdfdoc/include/cpdf_link.h" -#include "core/fxcrt/include/fx_system.h" - -class CPDF_Page; -class CPDF_Dictionary; - -class CPDF_LinkList { - public: - CPDF_LinkList(); - ~CPDF_LinkList(); - - CPDF_Link GetLinkAtPoint(CPDF_Page* pPage, - FX_FLOAT pdf_x, - FX_FLOAT pdf_y, - int* z_order); - - private: - const std::vector* GetPageLinks(CPDF_Page* pPage); - void LoadPageLinks(CPDF_Page* pPage, std::vector* pList); - - std::map> m_PageMap; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_LINKLIST_H_ diff --git a/core/fpdfdoc/include/cpdf_metadata.h b/core/fpdfdoc/include/cpdf_metadata.h deleted file mode 100644 index 31497dd33c..0000000000 --- a/core/fpdfdoc/include/cpdf_metadata.h +++ /dev/null @@ -1,26 +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_FPDFDOC_INCLUDE_CPDF_METADATA_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_METADATA_H_ - -#include - -class CPDF_Document; -class CXML_Element; - -class CPDF_Metadata { - public: - explicit CPDF_Metadata(CPDF_Document* pDoc); - ~CPDF_Metadata(); - - const CXML_Element* GetRoot() const; - - private: - std::unique_ptr m_pXmlElement; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_METADATA_H_ diff --git a/core/fpdfdoc/include/cpdf_nametree.h b/core/fpdfdoc/include/cpdf_nametree.h deleted file mode 100644 index 39a520ddfa..0000000000 --- a/core/fpdfdoc/include/cpdf_nametree.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_FPDFDOC_INCLUDE_CPDF_NAMETREE_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_NAMETREE_H_ - -#include "core/fxcrt/include/fx_string.h" - -class CPDF_Array; -class CPDF_Dictionary; -class CPDF_Document; -class CPDF_Object; - -class CPDF_NameTree { - public: - explicit CPDF_NameTree(CPDF_Dictionary* pRoot) : m_pRoot(pRoot) {} - CPDF_NameTree(CPDF_Document* pDoc, const CFX_ByteString& category); - - CPDF_Object* LookupValue(int nIndex, CFX_ByteString& csName) const; - CPDF_Object* LookupValue(const CFX_ByteString& csName) const; - CPDF_Array* LookupNamedDest(CPDF_Document* pDoc, const CFX_ByteString& sName); - - int GetIndex(const CFX_ByteString& csName) const; - size_t GetCount() const; - CPDF_Dictionary* GetRoot() const { return m_pRoot; } - - private: - CPDF_Dictionary* m_pRoot; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_NAMETREE_H_ diff --git a/core/fpdfdoc/include/cpdf_occontext.h b/core/fpdfdoc/include/cpdf_occontext.h deleted file mode 100644 index 38e81705e5..0000000000 --- a/core/fpdfdoc/include/cpdf_occontext.h +++ /dev/null @@ -1,42 +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_FPDFDOC_INCLUDE_CPDF_OCCONTEXT_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_OCCONTEXT_H_ - -#include - -#include "core/fxcrt/include/fx_string.h" - -class CPDF_Array; -class CPDF_Dictionary; -class CPDF_Document; -class CPDF_PageObject; - -class CPDF_OCContext { - public: - enum UsageType { View = 0, Design, Print, Export }; - - CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType); - ~CPDF_OCContext(); - - bool CheckOCGVisible(const CPDF_Dictionary* pOCGDict); - bool CheckObjectVisible(const CPDF_PageObject* pObj); - - private: - bool LoadOCGStateFromConfig(const CFX_ByteString& csConfig, - const CPDF_Dictionary* pOCGDict) const; - bool LoadOCGState(const CPDF_Dictionary* pOCGDict) const; - bool GetOCGVisible(const CPDF_Dictionary* pOCGDict); - bool GetOCGVE(CPDF_Array* pExpression, int nLevel); - bool LoadOCMDState(const CPDF_Dictionary* pOCMDDict); - - CPDF_Document* const m_pDocument; - const UsageType m_eUsageType; - std::unordered_map m_OCGStates; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_OCCONTEXT_H_ diff --git a/core/fpdfdoc/include/cpdf_variabletext.h b/core/fpdfdoc/include/cpdf_variabletext.h deleted file mode 100644 index 31cf75ff0b..0000000000 --- a/core/fpdfdoc/include/cpdf_variabletext.h +++ /dev/null @@ -1,245 +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_FPDFDOC_INCLUDE_CPDF_VARIABLETEXT_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_VARIABLETEXT_H_ - -#include - -#include "core/fpdfdoc/cpvt_arraytemplate.h" -#include "core/fpdfdoc/cpvt_floatrect.h" -#include "core/fpdfdoc/cpvt_lineinfo.h" -#include "core/fpdfdoc/include/cpvt_line.h" -#include "core/fpdfdoc/include/cpvt_wordplace.h" -#include "core/fpdfdoc/include/cpvt_wordrange.h" -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_string.h" -#include "core/fxcrt/include/fx_system.h" -#include "core/fxge/include/fx_font.h" - -class CSection; -class IPVT_FontMap; - -struct CPVT_SecProps; -struct CPVT_Section; -struct CPVT_SectionInfo; -struct CPVT_Word; -struct CPVT_WordInfo; -struct CPVT_WordProps; - -#define VARIABLETEXT_HALF 0.5f - -class CPDF_VariableText { - public: - enum class ScriptType { Normal, Super, Sub }; - - class Iterator { - public: - explicit Iterator(CPDF_VariableText* pVT); - ~Iterator(); - - FX_BOOL NextWord(); - FX_BOOL PrevWord(); - FX_BOOL NextLine(); - FX_BOOL PrevLine(); - FX_BOOL NextSection(); - FX_BOOL PrevSection(); - FX_BOOL SetWord(const CPVT_Word& word); - FX_BOOL GetWord(CPVT_Word& word) const; - FX_BOOL GetLine(CPVT_Line& line) const; - FX_BOOL GetSection(CPVT_Section& section) const; - FX_BOOL SetSection(const CPVT_Section& section); - void SetAt(int32_t nWordIndex); - void SetAt(const CPVT_WordPlace& place); - const CPVT_WordPlace& GetAt() const { return m_CurPos; } - - private: - CPVT_WordPlace m_CurPos; - CPDF_VariableText* const m_pVT; - }; - - class Provider { - public: - explicit Provider(IPVT_FontMap* pFontMap); - virtual ~Provider(); - - virtual int32_t GetCharWidth(int32_t nFontIndex, uint16_t word); - virtual int32_t GetTypeAscent(int32_t nFontIndex); - virtual int32_t GetTypeDescent(int32_t nFontIndex); - virtual int32_t GetWordFontIndex(uint16_t word, - int32_t charset, - int32_t nFontIndex); - virtual FX_BOOL IsLatinWord(uint16_t word); - virtual int32_t GetDefaultFontIndex(); - - private: - IPVT_FontMap* const m_pFontMap; - }; - - CPDF_VariableText(); - ~CPDF_VariableText(); - - void SetProvider(CPDF_VariableText::Provider* pProvider); - CPDF_VariableText::Iterator* GetIterator(); - - void SetContentRect(const CPVT_FloatRect& rect); - CFX_FloatRect GetContentRect() const; - void SetPlateRect(const CFX_FloatRect& rect); - const CFX_FloatRect& GetPlateRect() const; - - void SetAlignment(int32_t nFormat) { m_nAlignment = nFormat; } - void SetPasswordChar(uint16_t wSubWord) { m_wSubWord = wSubWord; } - void SetLimitChar(int32_t nLimitChar) { m_nLimitChar = nLimitChar; } - void SetCharSpace(FX_FLOAT fCharSpace) { m_fCharSpace = fCharSpace; } - void SetMultiLine(FX_BOOL bMultiLine) { m_bMultiLine = bMultiLine; } - void SetAutoReturn(FX_BOOL bAuto) { m_bLimitWidth = bAuto; } - void SetFontSize(FX_FLOAT fFontSize) { m_fFontSize = fFontSize; } - void SetCharArray(int32_t nCharArray) { m_nCharArray = nCharArray; } - void SetAutoFontSize(FX_BOOL bAuto) { m_bAutoFontSize = bAuto; } - void Initialize(); - - FX_BOOL IsValid() const { return m_bInitial; } - - void RearrangeAll(); - void RearrangePart(const CPVT_WordRange& PlaceRange); - void ResetAll(); - void SetText(const CFX_WideString& text); - CPVT_WordPlace InsertWord(const CPVT_WordPlace& place, - uint16_t word, - int32_t charset, - const CPVT_WordProps* pWordProps); - CPVT_WordPlace InsertSection(const CPVT_WordPlace& place, - const CPVT_SecProps* pSecProps, - const CPVT_WordProps* pWordProps); - CPVT_WordPlace InsertText(const CPVT_WordPlace& place, const FX_WCHAR* text); - CPVT_WordPlace DeleteWords(const CPVT_WordRange& PlaceRange); - CPVT_WordPlace DeleteWord(const CPVT_WordPlace& place); - CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace& place); - - int32_t GetTotalWords() const; - FX_FLOAT GetFontSize() const { return m_fFontSize; } - int32_t GetAlignment() const { return m_nAlignment; } - uint16_t GetPasswordChar() const { return GetSubWord(); } - int32_t GetCharArray() const { return m_nCharArray; } - int32_t GetLimitChar() const { return m_nLimitChar; } - FX_BOOL IsMultiLine() const { return m_bMultiLine; } - int32_t GetHorzScale() const { return m_nHorzScale; } - FX_FLOAT GetCharSpace() const { return m_fCharSpace; } - CPVT_WordPlace GetBeginWordPlace() const; - CPVT_WordPlace GetEndWordPlace() const; - CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace& place) const; - CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace& place) const; - CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const; - CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace& place, - const CFX_FloatPoint& point) const; - CPVT_WordPlace GetDownWordPlace(const CPVT_WordPlace& place, - const CFX_FloatPoint& point) const; - CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace& place) const; - CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace& place) const; - CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace& place) const; - CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace& place) const; - void UpdateWordPlace(CPVT_WordPlace& place) const; - CPVT_WordPlace AdjustLineHeader(const CPVT_WordPlace& place, - FX_BOOL bPrevOrNext) const; - int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const; - CPVT_WordPlace WordIndexToWordPlace(int32_t index) const; - - uint16_t GetSubWord() const { return m_wSubWord; } - - FX_FLOAT GetPlateWidth() const { return m_rcPlate.right - m_rcPlate.left; } - FX_FLOAT GetPlateHeight() const { return m_rcPlate.top - m_rcPlate.bottom; } - CFX_SizeF GetPlateSize() const; - CFX_FloatPoint GetBTPoint() const; - CFX_FloatPoint GetETPoint() const; - - CFX_FloatPoint InToOut(const CFX_FloatPoint& point) const; - CFX_FloatPoint OutToIn(const CFX_FloatPoint& point) const; - CFX_FloatRect InToOut(const CPVT_FloatRect& rect) const; - CPVT_FloatRect OutToIn(const CFX_FloatRect& rect) const; - - private: - friend class CTypeset; - friend class CSection; - - int32_t GetCharWidth(int32_t nFontIndex, uint16_t Word, uint16_t SubWord); - int32_t GetTypeAscent(int32_t nFontIndex); - int32_t GetTypeDescent(int32_t nFontIndex); - int32_t GetWordFontIndex(uint16_t word, int32_t charset, int32_t nFontIndex); - int32_t GetDefaultFontIndex(); - FX_BOOL IsLatinWord(uint16_t word); - - CPVT_WordPlace AddSection(const CPVT_WordPlace& place, - const CPVT_SectionInfo& secinfo); - CPVT_WordPlace AddLine(const CPVT_WordPlace& place, - const CPVT_LineInfo& lineinfo); - CPVT_WordPlace AddWord(const CPVT_WordPlace& place, - const CPVT_WordInfo& wordinfo); - FX_BOOL GetWordInfo(const CPVT_WordPlace& place, CPVT_WordInfo& wordinfo); - FX_BOOL SetWordInfo(const CPVT_WordPlace& place, - const CPVT_WordInfo& wordinfo); - FX_BOOL GetLineInfo(const CPVT_WordPlace& place, CPVT_LineInfo& lineinfo); - FX_BOOL GetSectionInfo(const CPVT_WordPlace& place, - CPVT_SectionInfo& secinfo); - FX_FLOAT GetWordFontSize(const CPVT_WordInfo& WordInfo); - FX_FLOAT GetWordWidth(int32_t nFontIndex, - uint16_t Word, - uint16_t SubWord, - FX_FLOAT fCharSpace, - int32_t nHorzScale, - FX_FLOAT fFontSize, - FX_FLOAT fWordTail); - FX_FLOAT GetWordWidth(const CPVT_WordInfo& WordInfo); - FX_FLOAT GetWordAscent(const CPVT_WordInfo& WordInfo, FX_FLOAT fFontSize); - FX_FLOAT GetWordDescent(const CPVT_WordInfo& WordInfo, FX_FLOAT fFontSize); - FX_FLOAT GetWordAscent(const CPVT_WordInfo& WordInfo); - FX_FLOAT GetWordDescent(const CPVT_WordInfo& WordInfo); - FX_FLOAT GetLineAscent(const CPVT_SectionInfo& SecInfo); - FX_FLOAT GetLineDescent(const CPVT_SectionInfo& SecInfo); - FX_FLOAT GetFontAscent(int32_t nFontIndex, FX_FLOAT fFontSize); - FX_FLOAT GetFontDescent(int32_t nFontIndex, FX_FLOAT fFontSize); - int32_t GetWordFontIndex(const CPVT_WordInfo& WordInfo); - FX_FLOAT GetCharSpace(const CPVT_WordInfo& WordInfo); - int32_t GetHorzScale(const CPVT_WordInfo& WordInfo); - FX_FLOAT GetLineLeading(const CPVT_SectionInfo& SecInfo); - FX_FLOAT GetLineIndent(const CPVT_SectionInfo& SecInfo); - int32_t GetAlignment(const CPVT_SectionInfo& SecInfo); - - void ClearSectionRightWords(const CPVT_WordPlace& place); - - FX_BOOL ClearEmptySection(const CPVT_WordPlace& place); - void ClearEmptySections(const CPVT_WordRange& PlaceRange); - void LinkLatterSection(const CPVT_WordPlace& place); - void ClearWords(const CPVT_WordRange& PlaceRange); - CPVT_WordPlace ClearLeftWord(const CPVT_WordPlace& place); - CPVT_WordPlace ClearRightWord(const CPVT_WordPlace& place); - - CPVT_FloatRect Rearrange(const CPVT_WordRange& PlaceRange); - FX_FLOAT GetAutoFontSize(); - bool IsBigger(FX_FLOAT fFontSize) const; - CPVT_FloatRect RearrangeSections(const CPVT_WordRange& PlaceRange); - - void ResetSectionArray(); - - CPVT_ArrayTemplate m_SectionArray; - int32_t m_nLimitChar; - int32_t m_nCharArray; - FX_BOOL m_bMultiLine; - FX_BOOL m_bLimitWidth; - FX_BOOL m_bAutoFontSize; - int32_t m_nAlignment; - FX_FLOAT m_fLineLeading; - FX_FLOAT m_fCharSpace; - int32_t m_nHorzScale; - uint16_t m_wSubWord; - FX_FLOAT m_fFontSize; - FX_BOOL m_bInitial; - CPDF_VariableText::Provider* m_pVTProvider; - std::unique_ptr m_pVTIterator; - CFX_FloatRect m_rcPlate; - CPVT_FloatRect m_rcContent; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_VARIABLETEXT_H_ diff --git a/core/fpdfdoc/include/cpdf_viewerpreferences.h b/core/fpdfdoc/include/cpdf_viewerpreferences.h deleted file mode 100644 index d93c261183..0000000000 --- a/core/fpdfdoc/include/cpdf_viewerpreferences.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_FPDFDOC_INCLUDE_CPDF_VIEWERPREFERENCES_H_ -#define CORE_FPDFDOC_INCLUDE_CPDF_VIEWERPREFERENCES_H_ - -#include "core/fxcrt/include/fx_string.h" -#include "core/fxcrt/include/fx_system.h" - -class CPDF_Array; -class CPDF_Dictionary; -class CPDF_Document; - -class CPDF_ViewerPreferences { - public: - explicit CPDF_ViewerPreferences(CPDF_Document* pDoc); - ~CPDF_ViewerPreferences(); - - FX_BOOL IsDirectionR2L() const; - FX_BOOL PrintScaling() const; - int32_t NumCopies() const; - CPDF_Array* PrintPageRange() const; - CFX_ByteString Duplex() const; - - private: - CPDF_Dictionary* GetViewerPreferences() const; - - CPDF_Document* const m_pDoc; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPDF_VIEWERPREFERENCES_H_ diff --git a/core/fpdfdoc/include/cpvt_line.h b/core/fpdfdoc/include/cpvt_line.h deleted file mode 100644 index d6c74edb4e..0000000000 --- a/core/fpdfdoc/include/cpvt_line.h +++ /dev/null @@ -1,25 +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_FPDFDOC_INCLUDE_CPVT_LINE_H_ -#define CORE_FPDFDOC_INCLUDE_CPVT_LINE_H_ - -#include "core/fpdfdoc/include/cpvt_wordplace.h" -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_system.h" - -struct CPVT_Line { - CPVT_Line() : fLineWidth(0.0f), fLineAscent(0.0f), fLineDescent(0.0f) {} - - CPVT_WordPlace lineplace; - CPVT_WordPlace lineEnd; - CFX_FloatPoint ptLine; - FX_FLOAT fLineWidth; - FX_FLOAT fLineAscent; - FX_FLOAT fLineDescent; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPVT_LINE_H_ diff --git a/core/fpdfdoc/include/cpvt_secprops.h b/core/fpdfdoc/include/cpvt_secprops.h deleted file mode 100644 index 67878f8625..0000000000 --- a/core/fpdfdoc/include/cpvt_secprops.h +++ /dev/null @@ -1,30 +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_FPDFDOC_INCLUDE_CPVT_SECPROPS_H_ -#define CORE_FPDFDOC_INCLUDE_CPVT_SECPROPS_H_ - -#include "core/fxcrt/include/fx_system.h" - -struct CPVT_SecProps { - CPVT_SecProps() : fLineLeading(0.0f), fLineIndent(0.0f), nAlignment(0) {} - - CPVT_SecProps(FX_FLOAT lineLeading, FX_FLOAT lineIndent, int32_t alignment) - : fLineLeading(lineLeading), - fLineIndent(lineIndent), - nAlignment(alignment) {} - - CPVT_SecProps(const CPVT_SecProps& other) - : fLineLeading(other.fLineLeading), - fLineIndent(other.fLineIndent), - nAlignment(other.nAlignment) {} - - FX_FLOAT fLineLeading; - FX_FLOAT fLineIndent; - int32_t nAlignment; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPVT_SECPROPS_H_ diff --git a/core/fpdfdoc/include/cpvt_section.h b/core/fpdfdoc/include/cpvt_section.h deleted file mode 100644 index a9820bd5f9..0000000000 --- a/core/fpdfdoc/include/cpvt_section.h +++ /dev/null @@ -1,22 +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_FPDFDOC_INCLUDE_CPVT_SECTION_H_ -#define CORE_FPDFDOC_INCLUDE_CPVT_SECTION_H_ - -#include "core/fpdfdoc/include/cpvt_secprops.h" -#include "core/fpdfdoc/include/cpvt_wordplace.h" -#include "core/fpdfdoc/include/cpvt_wordprops.h" -#include "core/fxcrt/include/fx_coordinates.h" - -struct CPVT_Section { - CPVT_WordPlace secplace; - CFX_FloatRect rcSection; - CPVT_SecProps SecProps; - CPVT_WordProps WordProps; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPVT_SECTION_H_ diff --git a/core/fpdfdoc/include/cpvt_word.h b/core/fpdfdoc/include/cpvt_word.h deleted file mode 100644 index b2af4ec6fa..0000000000 --- a/core/fpdfdoc/include/cpvt_word.h +++ /dev/null @@ -1,38 +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_FPDFDOC_INCLUDE_CPVT_WORD_H_ -#define CORE_FPDFDOC_INCLUDE_CPVT_WORD_H_ - -#include "core/fpdfdoc/include/cpvt_wordplace.h" -#include "core/fpdfdoc/include/cpvt_wordprops.h" -#include "core/fxcrt/include/fx_system.h" - -struct CPVT_Word { - CPVT_Word(); - - uint16_t Word; - int32_t nCharset; - CPVT_WordPlace WordPlace; - CFX_FloatPoint ptWord; - FX_FLOAT fAscent; - FX_FLOAT fDescent; - FX_FLOAT fWidth; - int32_t nFontIndex; - FX_FLOAT fFontSize; - CPVT_WordProps WordProps; -}; - -inline CPVT_Word::CPVT_Word() - : Word(0), - nCharset(0), - fAscent(0.0f), - fDescent(0.0f), - fWidth(0.0f), - nFontIndex(-1), - fFontSize(0.0f) {} - -#endif // CORE_FPDFDOC_INCLUDE_CPVT_WORD_H_ diff --git a/core/fpdfdoc/include/cpvt_wordplace.h b/core/fpdfdoc/include/cpvt_wordplace.h deleted file mode 100644 index ef7907797e..0000000000 --- a/core/fpdfdoc/include/cpvt_wordplace.h +++ /dev/null @@ -1,73 +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_FPDFDOC_INCLUDE_CPVT_WORDPLACE_H_ -#define CORE_FPDFDOC_INCLUDE_CPVT_WORDPLACE_H_ - -#include "core/fxcrt/include/fx_system.h" - -struct CPVT_WordPlace { - CPVT_WordPlace() : nSecIndex(-1), nLineIndex(-1), nWordIndex(-1) {} - - CPVT_WordPlace(int32_t other_nSecIndex, - int32_t other_nLineIndex, - int32_t other_nWordIndex) { - nSecIndex = other_nSecIndex; - nLineIndex = other_nLineIndex; - nWordIndex = other_nWordIndex; - } - - void Default() { nSecIndex = nLineIndex = nWordIndex = -1; } - - bool operator==(const CPVT_WordPlace& wp) const { - return wp.nSecIndex == nSecIndex && wp.nLineIndex == nLineIndex && - wp.nWordIndex == nWordIndex; - } - - FX_BOOL operator!=(const CPVT_WordPlace& wp) const { return !(*this == wp); } - - inline int32_t WordCmp(const CPVT_WordPlace& wp) const { - if (nSecIndex > wp.nSecIndex) - return 1; - if (nSecIndex < wp.nSecIndex) - return -1; - if (nLineIndex > wp.nLineIndex) - return 1; - if (nLineIndex < wp.nLineIndex) - return -1; - if (nWordIndex > wp.nWordIndex) - return 1; - if (nWordIndex < wp.nWordIndex) - return -1; - return 0; - } - - inline int32_t LineCmp(const CPVT_WordPlace& wp) const { - if (nSecIndex > wp.nSecIndex) - return 1; - if (nSecIndex < wp.nSecIndex) - return -1; - if (nLineIndex > wp.nLineIndex) - return 1; - if (nLineIndex < wp.nLineIndex) - return -1; - return 0; - } - - inline int32_t SecCmp(const CPVT_WordPlace& wp) const { - if (nSecIndex > wp.nSecIndex) - return 1; - if (nSecIndex < wp.nSecIndex) - return -1; - return 0; - } - - int32_t nSecIndex; - int32_t nLineIndex; - int32_t nWordIndex; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPVT_WORDPLACE_H_ diff --git a/core/fpdfdoc/include/cpvt_wordprops.h b/core/fpdfdoc/include/cpvt_wordprops.h deleted file mode 100644 index 690a5e1950..0000000000 --- a/core/fpdfdoc/include/cpvt_wordprops.h +++ /dev/null @@ -1,58 +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_FPDFDOC_INCLUDE_CPVT_WORDPROPS_H_ -#define CORE_FPDFDOC_INCLUDE_CPVT_WORDPROPS_H_ - -#include "core/fpdfdoc/include/cpdf_variabletext.h" -#include "core/fxcrt/include/fx_system.h" -#include "core/fxge/include/fx_dib.h" - -struct CPVT_WordProps { - CPVT_WordProps() - : nFontIndex(-1), - fFontSize(0.0f), - dwWordColor(0), - nScriptType(CPDF_VariableText::ScriptType::Normal), - nWordStyle(0), - fCharSpace(0.0f), - nHorzScale(0) {} - - CPVT_WordProps(int32_t fontIndex, - FX_FLOAT fontSize, - FX_COLORREF wordColor = 0, - CPDF_VariableText::ScriptType scriptType = - CPDF_VariableText::ScriptType::Normal, - int32_t wordStyle = 0, - FX_FLOAT charSpace = 0, - int32_t horzScale = 100) - : nFontIndex(fontIndex), - fFontSize(fontSize), - dwWordColor(wordColor), - nScriptType(scriptType), - nWordStyle(wordStyle), - fCharSpace(charSpace), - nHorzScale(horzScale) {} - - CPVT_WordProps(const CPVT_WordProps& other) - : nFontIndex(other.nFontIndex), - fFontSize(other.fFontSize), - dwWordColor(other.dwWordColor), - nScriptType(other.nScriptType), - nWordStyle(other.nWordStyle), - fCharSpace(other.fCharSpace), - nHorzScale(other.nHorzScale) {} - - int32_t nFontIndex; - FX_FLOAT fFontSize; - FX_COLORREF dwWordColor; - CPDF_VariableText::ScriptType nScriptType; - int32_t nWordStyle; - FX_FLOAT fCharSpace; - int32_t nHorzScale; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPVT_WORDPROPS_H_ diff --git a/core/fpdfdoc/include/cpvt_wordrange.h b/core/fpdfdoc/include/cpvt_wordrange.h deleted file mode 100644 index 3c6f05b159..0000000000 --- a/core/fpdfdoc/include/cpvt_wordrange.h +++ /dev/null @@ -1,59 +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_FPDFDOC_INCLUDE_CPVT_WORDRANGE_H_ -#define CORE_FPDFDOC_INCLUDE_CPVT_WORDRANGE_H_ - -#include "core/fpdfdoc/include/cpvt_wordplace.h" -#include "core/fxcrt/include/fx_system.h" - -struct CPVT_WordRange { - CPVT_WordRange() {} - - CPVT_WordRange(const CPVT_WordPlace& begin, const CPVT_WordPlace& end) { - Set(begin, end); - } - - void Default() { - BeginPos.Default(); - EndPos.Default(); - } - - void Set(const CPVT_WordPlace& begin, const CPVT_WordPlace& end) { - BeginPos = begin; - EndPos = end; - SwapWordPlace(); - } - - void SetBeginPos(const CPVT_WordPlace& begin) { - BeginPos = begin; - SwapWordPlace(); - } - - void SetEndPos(const CPVT_WordPlace& end) { - EndPos = end; - SwapWordPlace(); - } - - FX_BOOL IsExist() const { return BeginPos != EndPos; } - - FX_BOOL operator!=(const CPVT_WordRange& wr) const { - return wr.BeginPos != BeginPos || wr.EndPos != EndPos; - } - - void SwapWordPlace() { - if (BeginPos.WordCmp(EndPos) > 0) { - CPVT_WordPlace place = EndPos; - EndPos = BeginPos; - BeginPos = place; - } - } - - CPVT_WordPlace BeginPos; - CPVT_WordPlace EndPos; -}; - -#endif // CORE_FPDFDOC_INCLUDE_CPVT_WORDRANGE_H_ diff --git a/core/fpdfdoc/include/fpdf_tagged.h b/core/fpdfdoc/include/fpdf_tagged.h deleted file mode 100644 index 43d69e8db9..0000000000 --- a/core/fpdfdoc/include/fpdf_tagged.h +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2014 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_FPDFDOC_INCLUDE_FPDF_TAGGED_H_ -#define CORE_FPDFDOC_INCLUDE_FPDF_TAGGED_H_ - -#include "core/fxge/include/fx_dib.h" - -class CPDF_Dictionary; -class CPDF_Document; -class IPDF_StructElement; - -class IPDF_StructTree { - public: - static IPDF_StructTree* LoadDoc(const CPDF_Document* pDoc); - static IPDF_StructTree* LoadPage(const CPDF_Document* pDoc, - const CPDF_Dictionary* pPageDict); - - virtual ~IPDF_StructTree() {} - - virtual int CountTopElements() const = 0; - virtual IPDF_StructElement* GetTopElement(int i) const = 0; -}; - -struct CPDF_StructKid { - enum { Invalid, Element, PageContent, StreamContent, Object } m_Type; - - union { - struct { - IPDF_StructElement* m_pElement; - CPDF_Dictionary* m_pDict; - } m_Element; - struct { - uint32_t m_PageObjNum; - uint32_t m_ContentId; - } m_PageContent; - struct { - uint32_t m_PageObjNum; - uint32_t m_ContentId; - uint32_t m_RefObjNum; - } m_StreamContent; - struct { - uint32_t m_PageObjNum; - uint32_t m_RefObjNum; - } m_Object; - }; -}; - -class IPDF_StructElement { - public: - virtual ~IPDF_StructElement() {} - - virtual IPDF_StructTree* GetTree() const = 0; - virtual const CFX_ByteString& GetType() const = 0; - virtual IPDF_StructElement* GetParent() const = 0; - virtual CPDF_Dictionary* GetDict() const = 0; - virtual int CountKids() const = 0; - virtual const CPDF_StructKid& GetKid(int index) const = 0; - - virtual CPDF_Object* GetAttr(const CFX_ByteStringC& owner, - const CFX_ByteStringC& name, - FX_BOOL bInheritable = FALSE, - FX_FLOAT fLevel = 0.0F) = 0; - - virtual CFX_ByteString GetName(const CFX_ByteStringC& owner, - const CFX_ByteStringC& name, - const CFX_ByteStringC& default_value, - FX_BOOL bInheritable = FALSE, - int subindex = -1) = 0; - - virtual FX_ARGB GetColor(const CFX_ByteStringC& owner, - const CFX_ByteStringC& name, - FX_ARGB default_value, - FX_BOOL bInheritable = FALSE, - int subindex = -1) = 0; - - virtual FX_FLOAT GetNumber(const CFX_ByteStringC& owner, - const CFX_ByteStringC& name, - FX_FLOAT default_value, - FX_BOOL bInheritable = FALSE, - int subindex = -1) = 0; - - virtual int GetInteger(const CFX_ByteStringC& owner, - const CFX_ByteStringC& name, - int default_value, - FX_BOOL bInheritable = FALSE, - int subindex = -1) = 0; -}; - -#endif // CORE_FPDFDOC_INCLUDE_FPDF_TAGGED_H_ diff --git a/core/fpdfdoc/include/ipdf_formnotify.h b/core/fpdfdoc/include/ipdf_formnotify.h deleted file mode 100644 index 49bb84d81e..0000000000 --- a/core/fpdfdoc/include/ipdf_formnotify.h +++ /dev/null @@ -1,32 +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_FPDFDOC_INCLUDE_IPDF_FORMNOTIFY_H_ -#define CORE_FPDFDOC_INCLUDE_IPDF_FORMNOTIFY_H_ - -#include "core/fxcrt/include/fx_string.h" - -class CPDF_FormField; -class CPDF_InterForm; - -class IPDF_FormNotify { - public: - virtual ~IPDF_FormNotify() {} - - virtual int BeforeValueChange(CPDF_FormField* pField, - const CFX_WideString& csValue) = 0; - virtual void AfterValueChange(CPDF_FormField* pField) = 0; - virtual int BeforeSelectionChange(CPDF_FormField* pField, - const CFX_WideString& csValue) = 0; - virtual void AfterSelectionChange(CPDF_FormField* pField) = 0; - virtual void AfterCheckedStatusChange(CPDF_FormField* pField) = 0; - virtual int BeforeFormReset(CPDF_InterForm* pForm) = 0; - virtual void AfterFormReset(CPDF_InterForm* pForm) = 0; - virtual int BeforeFormImportData(CPDF_InterForm* pForm) = 0; - virtual void AfterFormImportData(CPDF_InterForm* pForm) = 0; -}; - -#endif // CORE_FPDFDOC_INCLUDE_IPDF_FORMNOTIFY_H_ diff --git a/core/fpdfdoc/include/ipvt_fontmap.h b/core/fpdfdoc/include/ipvt_fontmap.h deleted file mode 100644 index 9835d5ec12..0000000000 --- a/core/fpdfdoc/include/ipvt_fontmap.h +++ /dev/null @@ -1,29 +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_FPDFDOC_INCLUDE_IPVT_FONTMAP_H_ -#define CORE_FPDFDOC_INCLUDE_IPVT_FONTMAP_H_ - -#include - -#include "core/fxcrt/include/fx_string.h" - -class CPDF_Font; - -class IPVT_FontMap { - public: - virtual ~IPVT_FontMap() {} - - virtual CPDF_Font* GetPDFFont(int32_t nFontIndex) = 0; - virtual CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) = 0; - virtual int32_t GetWordFontIndex(uint16_t word, - int32_t charset, - int32_t nFontIndex) = 0; - virtual int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) = 0; - virtual int32_t CharSetFromUnicode(uint16_t word, int32_t nOldCharset) = 0; -}; - -#endif // CORE_FPDFDOC_INCLUDE_IPVT_FONTMAP_H_ diff --git a/core/fpdfdoc/ipdf_formnotify.h b/core/fpdfdoc/ipdf_formnotify.h new file mode 100644 index 0000000000..4937bb1f0e --- /dev/null +++ b/core/fpdfdoc/ipdf_formnotify.h @@ -0,0 +1,32 @@ +// 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_FPDFDOC_IPDF_FORMNOTIFY_H_ +#define CORE_FPDFDOC_IPDF_FORMNOTIFY_H_ + +#include "core/fxcrt/include/fx_string.h" + +class CPDF_FormField; +class CPDF_InterForm; + +class IPDF_FormNotify { + public: + virtual ~IPDF_FormNotify() {} + + virtual int BeforeValueChange(CPDF_FormField* pField, + const CFX_WideString& csValue) = 0; + virtual void AfterValueChange(CPDF_FormField* pField) = 0; + virtual int BeforeSelectionChange(CPDF_FormField* pField, + const CFX_WideString& csValue) = 0; + virtual void AfterSelectionChange(CPDF_FormField* pField) = 0; + virtual void AfterCheckedStatusChange(CPDF_FormField* pField) = 0; + virtual int BeforeFormReset(CPDF_InterForm* pForm) = 0; + virtual void AfterFormReset(CPDF_InterForm* pForm) = 0; + virtual int BeforeFormImportData(CPDF_InterForm* pForm) = 0; + virtual void AfterFormImportData(CPDF_InterForm* pForm) = 0; +}; + +#endif // CORE_FPDFDOC_IPDF_FORMNOTIFY_H_ diff --git a/core/fpdfdoc/ipvt_fontmap.h b/core/fpdfdoc/ipvt_fontmap.h new file mode 100644 index 0000000000..072783b70c --- /dev/null +++ b/core/fpdfdoc/ipvt_fontmap.h @@ -0,0 +1,29 @@ +// 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_FPDFDOC_IPVT_FONTMAP_H_ +#define CORE_FPDFDOC_IPVT_FONTMAP_H_ + +#include + +#include "core/fxcrt/include/fx_string.h" + +class CPDF_Font; + +class IPVT_FontMap { + public: + virtual ~IPVT_FontMap() {} + + virtual CPDF_Font* GetPDFFont(int32_t nFontIndex) = 0; + virtual CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) = 0; + virtual int32_t GetWordFontIndex(uint16_t word, + int32_t charset, + int32_t nFontIndex) = 0; + virtual int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) = 0; + virtual int32_t CharSetFromUnicode(uint16_t word, int32_t nOldCharset) = 0; +}; + +#endif // CORE_FPDFDOC_IPVT_FONTMAP_H_ diff --git a/core/fpdfdoc/tagged_int.h b/core/fpdfdoc/tagged_int.h index 354a93cb76..871a01eeb7 100644 --- a/core/fpdfdoc/tagged_int.h +++ b/core/fpdfdoc/tagged_int.h @@ -11,7 +11,7 @@ #include #include -#include "core/fpdfdoc/include/fpdf_tagged.h" +#include "core/fpdfdoc/fpdf_tagged.h" #include "core/fxcrt/include/cfx_retain_ptr.h" #include "third_party/base/stl_util.h" diff --git a/fpdfsdk/DEPS b/fpdfsdk/DEPS index f5e84768ff..30e2079961 100644 --- a/fpdfsdk/DEPS +++ b/fpdfsdk/DEPS @@ -5,7 +5,7 @@ include_rules = [ '+core/fpdfapi/fpdf_page', '+core/fpdfapi/fpdf_parser', '+core/fpdfapi/fpdf_render', - '+core/fpdfdoc/include', + '+core/fpdfdoc', '+core/fxcodec/include', '+core/fxcrt/include', '+core/fxge/include', diff --git a/fpdfsdk/cpdfsdk_annothandlermgr.cpp b/fpdfsdk/cpdfsdk_annothandlermgr.cpp index 75542d360e..9dd5a4e46f 100644 --- a/fpdfsdk/cpdfsdk_annothandlermgr.cpp +++ b/fpdfsdk/cpdfsdk_annothandlermgr.cpp @@ -6,7 +6,7 @@ #include "fpdfsdk/include/cpdfsdk_annothandlermgr.h" -#include "core/fpdfdoc/include/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_annot.h" #include "fpdfsdk/include/cba_annotiterator.h" #include "fpdfsdk/include/cpdfsdk_annot.h" #include "fpdfsdk/include/cpdfsdk_baannot.h" diff --git a/fpdfsdk/cpdfsdk_baannothandler.cpp b/fpdfsdk/cpdfsdk_baannothandler.cpp index ebbf2c11e4..4f5213e42e 100644 --- a/fpdfsdk/cpdfsdk_baannothandler.cpp +++ b/fpdfsdk/cpdfsdk_baannothandler.cpp @@ -11,7 +11,7 @@ #include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fpdfdoc/include/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_interform.h" #include "fpdfsdk/formfiller/cffl_formfiller.h" #include "fpdfsdk/include/cpdfsdk_annot.h" #include "fpdfsdk/include/cpdfsdk_baannot.h" diff --git a/fpdfsdk/cpdfsdk_document.cpp b/fpdfsdk/cpdfsdk_document.cpp index 09093fe80d..7c4686f4b3 100644 --- a/fpdfsdk/cpdfsdk_document.cpp +++ b/fpdfsdk/cpdfsdk_document.cpp @@ -10,9 +10,9 @@ #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/cpdf_object.h" -#include "core/fpdfdoc/include/cpdf_action.h" -#include "core/fpdfdoc/include/cpdf_docjsactions.h" -#include "core/fpdfdoc/include/cpdf_occontext.h" +#include "core/fpdfdoc/cpdf_action.h" +#include "core/fpdfdoc/cpdf_docjsactions.h" +#include "core/fpdfdoc/cpdf_occontext.h" #include "fpdfsdk/include/cpdfsdk_annot.h" #include "fpdfsdk/include/cpdfsdk_annothandlermgr.h" #include "fpdfsdk/include/cpdfsdk_environment.h" diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp index e41df1df28..9afd30b57b 100644 --- a/fpdfsdk/cpdfsdk_interform.cpp +++ b/fpdfsdk/cpdfsdk_interform.cpp @@ -15,8 +15,8 @@ #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" -#include "core/fpdfdoc/include/cpdf_actionfields.h" -#include "core/fpdfdoc/include/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_actionfields.h" +#include "core/fpdfdoc/cpdf_interform.h" #include "core/fxge/include/cfx_graphstatedata.h" #include "core/fxge/include/cfx_pathdata.h" #include "core/fxge/include/cfx_renderdevice.h" diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp index 0ffc3fc610..cb76a8a571 100644 --- a/fpdfsdk/cpdfsdk_pageview.cpp +++ b/fpdfsdk/cpdfsdk_pageview.cpp @@ -11,8 +11,8 @@ #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" -#include "core/fpdfdoc/include/cpdf_annotlist.h" -#include "core/fpdfdoc/include/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_annotlist.h" +#include "core/fpdfdoc/cpdf_interform.h" #include "fpdfsdk/include/cpdfsdk_annot.h" #include "fpdfsdk/include/cpdfsdk_annothandlermgr.h" #include "fpdfsdk/include/cpdfsdk_annotiterator.h" diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp index f0583dd8f3..284fe8a762 100644 --- a/fpdfsdk/cpdfsdk_widget.cpp +++ b/fpdfsdk/cpdfsdk_widget.cpp @@ -11,11 +11,11 @@ #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" -#include "core/fpdfdoc/include/cpdf_defaultappearance.h" -#include "core/fpdfdoc/include/cpdf_formcontrol.h" -#include "core/fpdfdoc/include/cpdf_formfield.h" -#include "core/fpdfdoc/include/cpdf_iconfit.h" -#include "core/fpdfdoc/include/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_defaultappearance.h" +#include "core/fpdfdoc/cpdf_formcontrol.h" +#include "core/fpdfdoc/cpdf_formfield.h" +#include "core/fpdfdoc/cpdf_iconfit.h" +#include "core/fpdfdoc/cpdf_interform.h" #include "core/fxge/include/cfx_graphstatedata.h" #include "core/fxge/include/cfx_pathdata.h" #include "core/fxge/include/cfx_renderdevice.h" diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp index c84372ea52..208877edaf 100644 --- a/fpdfsdk/cpdfsdk_widgethandler.cpp +++ b/fpdfsdk/cpdfsdk_widgethandler.cpp @@ -11,7 +11,7 @@ #include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fpdfdoc/include/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_interform.h" #include "fpdfsdk/formfiller/cffl_formfiller.h" #include "fpdfsdk/include/cpdfsdk_annot.h" #include "fpdfsdk/include/cpdfsdk_document.h" diff --git a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp index 381699155e..2abe9944f0 100644 --- a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp +++ b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp @@ -6,7 +6,7 @@ #include "fpdfsdk/include/cpdfsdk_xfawidgethandler.h" -#include "core/fpdfdoc/include/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_interform.h" #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" #include "fpdfsdk/include/cpdfsdk_annot.h" #include "fpdfsdk/include/cpdfsdk_document.h" diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp index 9e2a53f496..60e17a3ae8 100644 --- a/fpdfsdk/formfiller/cba_fontmap.cpp +++ b/fpdfsdk/formfiller/cba_fontmap.cpp @@ -12,7 +12,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_simple_parser.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" -#include "core/fpdfdoc/include/cpdf_formfield.h" +#include "core/fpdfdoc/cpdf_formfield.h" #include "core/fxge/include/cfx_substfont.h" #include "fpdfsdk/include/cpdfsdk_annot.h" diff --git a/fpdfsdk/fpdf_ext.cpp b/fpdfsdk/fpdf_ext.cpp index d261b7150c..f9ae0c0cde 100644 --- a/fpdfsdk/fpdf_ext.cpp +++ b/fpdfsdk/fpdf_ext.cpp @@ -11,9 +11,9 @@ #include "core/fpdfapi/cpdf_modulemgr.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fpdfdoc/include/cpdf_annot.h" -#include "core/fpdfdoc/include/cpdf_interform.h" -#include "core/fpdfdoc/include/cpdf_metadata.h" +#include "core/fpdfdoc/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_metadata.h" #include "core/fxcrt/include/fx_basic.h" #include "core/fxcrt/include/fx_memory.h" #include "core/fxcrt/include/fx_xml.h" diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp index 1f3305b8c0..69c7a32207 100644 --- a/fpdfsdk/fpdf_flatten.cpp +++ b/fpdfsdk/fpdf_flatten.cpp @@ -15,7 +15,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_number.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h" -#include "core/fpdfdoc/include/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_annot.h" #include "fpdfsdk/include/fsdk_define.h" typedef CFX_ArrayTemplate CPDF_ObjectArray; diff --git a/fpdfsdk/fpdfdoc.cpp b/fpdfsdk/fpdfdoc.cpp index 55297bb2c0..4e0d05c30b 100644 --- a/fpdfsdk/fpdfdoc.cpp +++ b/fpdfsdk/fpdfdoc.cpp @@ -11,8 +11,8 @@ #include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fpdfdoc/include/cpdf_bookmark.h" -#include "core/fpdfdoc/include/cpdf_bookmarktree.h" +#include "core/fpdfdoc/cpdf_bookmark.h" +#include "core/fpdfdoc/cpdf_bookmarktree.h" #include "fpdfsdk/include/fsdk_define.h" #include "third_party/base/stl_util.h" diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp index 5a0c6a4905..acbb295a63 100644 --- a/fpdfsdk/fpdfeditpage.cpp +++ b/fpdfsdk/fpdfeditpage.cpp @@ -22,8 +22,8 @@ #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/cpdf_number.h" #include "core/fpdfapi/fpdf_parser/cpdf_string.h" -#include "core/fpdfdoc/include/cpdf_annot.h" -#include "core/fpdfdoc/include/cpdf_annotlist.h" +#include "core/fpdfdoc/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_annotlist.h" #include "fpdfsdk/include/fsdk_define.h" #include "public/fpdf_formfill.h" #include "third_party/base/stl_util.h" diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp index 4abeb81aae..11d4467854 100644 --- a/fpdfsdk/fpdfformfill.cpp +++ b/fpdfsdk/fpdfformfill.cpp @@ -12,10 +12,10 @@ #include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" -#include "core/fpdfdoc/include/cpdf_formcontrol.h" -#include "core/fpdfdoc/include/cpdf_formfield.h" -#include "core/fpdfdoc/include/cpdf_interform.h" -#include "core/fpdfdoc/include/cpdf_occontext.h" +#include "core/fpdfdoc/cpdf_formcontrol.h" +#include "core/fpdfdoc/cpdf_formfield.h" +#include "core/fpdfdoc/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_occontext.h" #include "core/fxge/include/cfx_fxgedevice.h" #include "fpdfsdk/include/cpdfsdk_document.h" #include "fpdfsdk/include/cpdfsdk_environment.h" diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdftext.cpp index 7662b7d7cb..4a637b7662 100644 --- a/fpdfsdk/fpdftext.cpp +++ b/fpdfsdk/fpdftext.cpp @@ -7,7 +7,7 @@ #include "public/fpdf_text.h" #include "core/fpdfapi/fpdf_page/cpdf_page.h" -#include "core/fpdfdoc/include/cpdf_viewerpreferences.h" +#include "core/fpdfdoc/cpdf_viewerpreferences.h" #include "core/fpdftext/include/cpdf_linkextract.h" #include "core/fpdftext/include/cpdf_textpage.h" #include "core/fpdftext/include/cpdf_textpagefind.h" diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 05f73e8517..d6d7f3b8e8 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -17,10 +17,10 @@ #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" #include "core/fpdfapi/fpdf_render/cpdf_progressiverenderer.h" #include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" -#include "core/fpdfdoc/include/cpdf_annotlist.h" -#include "core/fpdfdoc/include/cpdf_nametree.h" -#include "core/fpdfdoc/include/cpdf_occontext.h" -#include "core/fpdfdoc/include/cpdf_viewerpreferences.h" +#include "core/fpdfdoc/cpdf_annotlist.h" +#include "core/fpdfdoc/cpdf_nametree.h" +#include "core/fpdfdoc/cpdf_occontext.h" +#include "core/fpdfdoc/cpdf_viewerpreferences.h" #include "core/fxcodec/include/fx_codec.h" #include "core/fxcrt/include/fx_memory.h" #include "core/fxcrt/include/fx_safe_types.h" diff --git a/fpdfsdk/fsdk_actionhandler.cpp b/fpdfsdk/fsdk_actionhandler.cpp index 021d5a066b..d904352915 100644 --- a/fpdfsdk/fsdk_actionhandler.cpp +++ b/fpdfsdk/fsdk_actionhandler.cpp @@ -9,8 +9,8 @@ #include #include "core/fpdfapi/fpdf_parser/cpdf_array.h" -#include "core/fpdfdoc/include/cpdf_formfield.h" -#include "core/fpdfdoc/include/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_formfield.h" +#include "core/fpdfdoc/cpdf_interform.h" #include "fpdfsdk/include/cpdfsdk_document.h" #include "fpdfsdk/include/cpdfsdk_environment.h" #include "fpdfsdk/include/cpdfsdk_interform.h" diff --git a/fpdfsdk/fxedit/DEPS b/fpdfsdk/fxedit/DEPS index 973ea055cf..a8612e1c54 100644 --- a/fpdfsdk/fxedit/DEPS +++ b/fpdfsdk/fxedit/DEPS @@ -1,4 +1,4 @@ include_rules = [ '+core/fpdfapi/fpdf_font', - '+core/fpdfdoc/include', + '+core/fpdfdoc', ] diff --git a/fpdfsdk/fxedit/fxet_ap.cpp b/fpdfsdk/fxedit/fxet_ap.cpp index 7bd7e61f6c..e3fb03432a 100644 --- a/fpdfsdk/fxedit/fxet_ap.cpp +++ b/fpdfsdk/fxedit/fxet_ap.cpp @@ -6,8 +6,8 @@ #include "core/fpdfapi/fpdf_font/cpdf_font.h" #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" -#include "core/fpdfdoc/include/cpvt_word.h" -#include "core/fpdfdoc/include/ipvt_fontmap.h" +#include "core/fpdfdoc/cpvt_word.h" +#include "core/fpdfdoc/ipvt_fontmap.h" #include "fpdfsdk/fxedit/include/fx_edit.h" #include "fpdfsdk/fxedit/include/fxet_edit.h" diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp index f7597d2369..db299e5bf7 100644 --- a/fpdfsdk/fxedit/fxet_edit.cpp +++ b/fpdfsdk/fxedit/fxet_edit.cpp @@ -18,9 +18,9 @@ #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" #include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" #include "core/fpdfapi/fpdf_render/cpdf_textrenderer.h" -#include "core/fpdfdoc/include/cpvt_section.h" -#include "core/fpdfdoc/include/cpvt_word.h" -#include "core/fpdfdoc/include/ipvt_fontmap.h" +#include "core/fpdfdoc/cpvt_section.h" +#include "core/fpdfdoc/cpvt_word.h" +#include "core/fpdfdoc/ipvt_fontmap.h" #include "core/fxge/include/cfx_graphstatedata.h" #include "core/fxge/include/cfx_pathdata.h" #include "core/fxge/include/cfx_renderdevice.h" diff --git a/fpdfsdk/fxedit/fxet_list.cpp b/fpdfsdk/fxedit/fxet_list.cpp index 5fb26b119e..5c51446db4 100644 --- a/fpdfsdk/fxedit/fxet_list.cpp +++ b/fpdfsdk/fxedit/fxet_list.cpp @@ -6,7 +6,7 @@ #include "fpdfsdk/fxedit/include/fxet_list.h" -#include "core/fpdfdoc/include/cpvt_word.h" +#include "core/fpdfdoc/cpvt_word.h" #include "fpdfsdk/fxedit/include/fxet_edit.h" #include "fpdfsdk/pdfwindow/PWL_ListBox.h" diff --git a/fpdfsdk/fxedit/include/DEPS b/fpdfsdk/fxedit/include/DEPS index db9a09c342..0b00511fb2 100644 --- a/fpdfsdk/fxedit/include/DEPS +++ b/fpdfsdk/fxedit/include/DEPS @@ -1,3 +1,3 @@ include_rules = [ - '+core/fpdfdoc/include', + '+core/fpdfdoc', ] diff --git a/fpdfsdk/fxedit/include/fxet_edit.h b/fpdfsdk/fxedit/include/fxet_edit.h index 22db613d57..652dbbf2ce 100644 --- a/fpdfsdk/fxedit/include/fxet_edit.h +++ b/fpdfsdk/fxedit/include/fxet_edit.h @@ -9,8 +9,8 @@ #include -#include "core/fpdfdoc/include/cpvt_secprops.h" -#include "core/fpdfdoc/include/cpvt_wordprops.h" +#include "core/fpdfdoc/cpvt_secprops.h" +#include "core/fpdfdoc/cpvt_wordprops.h" #include "fpdfsdk/fxedit/include/fx_edit.h" class CFFL_FormFiller; diff --git a/fpdfsdk/include/cba_annotiterator.h b/fpdfsdk/include/cba_annotiterator.h index aa0ad2d72b..7d9078e23d 100644 --- a/fpdfsdk/include/cba_annotiterator.h +++ b/fpdfsdk/include/cba_annotiterator.h @@ -9,7 +9,7 @@ #include -#include "core/fpdfdoc/include/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_annot.h" #include "core/fxcrt/include/fx_coordinates.h" #include "core/fxcrt/include/fx_string.h" diff --git a/fpdfsdk/include/cpdfsdk_annot.h b/fpdfsdk/include/cpdfsdk_annot.h index e7ae2e15a2..7356ce821b 100644 --- a/fpdfsdk/include/cpdfsdk_annot.h +++ b/fpdfsdk/include/cpdfsdk_annot.h @@ -7,9 +7,9 @@ #ifndef FPDFSDK_INCLUDE_CPDFSDK_ANNOT_H_ #define FPDFSDK_INCLUDE_CPDFSDK_ANNOT_H_ -#include "core/fpdfdoc/include/cpdf_aaction.h" -#include "core/fpdfdoc/include/cpdf_annot.h" -#include "core/fpdfdoc/include/cpdf_defaultappearance.h" +#include "core/fpdfdoc/cpdf_aaction.h" +#include "core/fpdfdoc/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_defaultappearance.h" #include "core/fxcrt/include/cfx_observable.h" #include "core/fxcrt/include/fx_basic.h" #include "fpdfsdk/cfx_systemhandler.h" diff --git a/fpdfsdk/include/cpdfsdk_annothandlermgr.h b/fpdfsdk/include/cpdfsdk_annothandlermgr.h index d66914aafb..da54c7e54b 100644 --- a/fpdfsdk/include/cpdfsdk_annothandlermgr.h +++ b/fpdfsdk/include/cpdfsdk_annothandlermgr.h @@ -10,7 +10,7 @@ #include #include -#include "core/fpdfdoc/include/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_annot.h" #include "core/fxcrt/include/fx_basic.h" #include "core/fxcrt/include/fx_coordinates.h" #include "fpdfsdk/include/cpdfsdk_annot.h" diff --git a/fpdfsdk/include/cpdfsdk_baannot.h b/fpdfsdk/include/cpdfsdk_baannot.h index 4575bfe087..9cc1680bee 100644 --- a/fpdfsdk/include/cpdfsdk_baannot.h +++ b/fpdfsdk/include/cpdfsdk_baannot.h @@ -7,10 +7,10 @@ #ifndef FPDFSDK_INCLUDE_CPDFSDK_BAANNOT_H_ #define FPDFSDK_INCLUDE_CPDFSDK_BAANNOT_H_ -#include "core/fpdfdoc/include/cpdf_aaction.h" -#include "core/fpdfdoc/include/cpdf_action.h" -#include "core/fpdfdoc/include/cpdf_annot.h" -#include "core/fpdfdoc/include/cpdf_defaultappearance.h" +#include "core/fpdfdoc/cpdf_aaction.h" +#include "core/fpdfdoc/cpdf_action.h" +#include "core/fpdfdoc/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_defaultappearance.h" #include "core/fxcrt/include/fx_coordinates.h" #include "core/fxcrt/include/fx_string.h" #include "fpdfsdk/cfx_systemhandler.h" diff --git a/fpdfsdk/include/cpdfsdk_environment.h b/fpdfsdk/include/cpdfsdk_environment.h index 4cf39f2145..35b48507ad 100644 --- a/fpdfsdk/include/cpdfsdk_environment.h +++ b/fpdfsdk/include/cpdfsdk_environment.h @@ -11,7 +11,7 @@ #include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fpdfdoc/include/cpdf_occontext.h" +#include "core/fpdfdoc/cpdf_occontext.h" #include "core/fxcrt/include/cfx_observable.h" #include "fpdfsdk/cfx_systemhandler.h" #include "fpdfsdk/include/fsdk_define.h" diff --git a/fpdfsdk/include/cpdfsdk_interform.h b/fpdfsdk/include/cpdfsdk_interform.h index b4b5db3fca..b186ceb8cc 100644 --- a/fpdfsdk/include/cpdfsdk_interform.h +++ b/fpdfsdk/include/cpdfsdk_interform.h @@ -10,8 +10,8 @@ #include #include -#include "core/fpdfdoc/include/cpdf_action.h" -#include "core/fpdfdoc/include/ipdf_formnotify.h" +#include "core/fpdfdoc/cpdf_action.h" +#include "core/fpdfdoc/ipdf_formnotify.h" #include "core/fxcrt/include/fx_basic.h" #include "core/fxge/include/fx_dib.h" diff --git a/fpdfsdk/include/cpdfsdk_widget.h b/fpdfsdk/include/cpdfsdk_widget.h index 09f9d94693..01710917ff 100644 --- a/fpdfsdk/include/cpdfsdk_widget.h +++ b/fpdfsdk/include/cpdfsdk_widget.h @@ -9,9 +9,9 @@ #include -#include "core/fpdfdoc/include/cpdf_aaction.h" -#include "core/fpdfdoc/include/cpdf_action.h" -#include "core/fpdfdoc/include/cpdf_annot.h" +#include "core/fpdfdoc/cpdf_aaction.h" +#include "core/fpdfdoc/cpdf_action.h" +#include "core/fpdfdoc/cpdf_annot.h" #include "core/fxcrt/include/fx_coordinates.h" #include "core/fxcrt/include/fx_string.h" #include "fpdfsdk/include/cpdfsdk_baannot.h" diff --git a/fpdfsdk/include/fsdk_actionhandler.h b/fpdfsdk/include/fsdk_actionhandler.h index 5262439d81..fc6758898f 100644 --- a/fpdfsdk/include/fsdk_actionhandler.h +++ b/fpdfsdk/include/fsdk_actionhandler.h @@ -10,8 +10,8 @@ #include #include -#include "core/fpdfdoc/include/cpdf_aaction.h" -#include "core/fpdfdoc/include/cpdf_action.h" +#include "core/fpdfdoc/cpdf_aaction.h" +#include "core/fpdfdoc/cpdf_action.h" #include "core/fxcrt/include/fx_string.h" #include "fpdfsdk/include/pdfsdk_fieldaction.h" diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp index 1f6fb7d15e..594a92e099 100644 --- a/fpdfsdk/javascript/Document.cpp +++ b/fpdfsdk/javascript/Document.cpp @@ -14,8 +14,8 @@ #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" -#include "core/fpdfdoc/include/cpdf_interform.h" -#include "core/fpdfdoc/include/cpdf_nametree.h" +#include "core/fpdfdoc/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_nametree.h" #include "fpdfsdk/include/cpdfsdk_annotiterator.h" #include "fpdfsdk/include/cpdfsdk_document.h" #include "fpdfsdk/include/cpdfsdk_environment.h" diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp index 7a0494f41e..0e65b16619 100644 --- a/fpdfsdk/javascript/Field.cpp +++ b/fpdfsdk/javascript/Field.cpp @@ -14,7 +14,7 @@ #include "core/fpdfapi/fpdf_font/cpdf_font.h" #include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fpdfdoc/include/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_interform.h" #include "fpdfsdk/include/cpdfsdk_document.h" #include "fpdfsdk/include/cpdfsdk_environment.h" #include "fpdfsdk/include/cpdfsdk_interform.h" diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp index 65af6a1fa5..c7f7b85f45 100644 --- a/fpdfsdk/javascript/PublicMethods.cpp +++ b/fpdfsdk/javascript/PublicMethods.cpp @@ -9,7 +9,7 @@ #include #include -#include "core/fpdfdoc/include/cpdf_interform.h" +#include "core/fpdfdoc/cpdf_interform.h" #include "core/fxcrt/include/fx_ext.h" #include "fpdfsdk/include/cpdfsdk_document.h" #include "fpdfsdk/include/cpdfsdk_environment.h" diff --git a/fpdfsdk/pdfwindow/DEPS b/fpdfsdk/pdfwindow/DEPS index 973ea055cf..a8612e1c54 100644 --- a/fpdfsdk/pdfwindow/DEPS +++ b/fpdfsdk/pdfwindow/DEPS @@ -1,4 +1,4 @@ include_rules = [ '+core/fpdfapi/fpdf_font', - '+core/fpdfdoc/include', + '+core/fpdfdoc', ] diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp index fc7d04cdef..b87d3390ea 100644 --- a/fpdfsdk/pdfwindow/PWL_Edit.cpp +++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp @@ -9,7 +9,7 @@ #include #include "core/fpdfapi/fpdf_font/cpdf_font.h" -#include "core/fpdfdoc/include/cpvt_word.h" +#include "core/fpdfdoc/cpvt_word.h" #include "core/fxcrt/include/fx_safe_types.h" #include "core/fxcrt/include/fx_xml.h" #include "core/fxge/include/cfx_graphstatedata.h" diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp index 2ec88cb15e..c99af4d155 100644 --- a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp +++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp @@ -6,8 +6,8 @@ #include "fpdfsdk/pdfwindow/PWL_EditCtrl.h" -#include "core/fpdfdoc/include/cpvt_section.h" -#include "core/fpdfdoc/include/cpvt_word.h" +#include "core/fpdfdoc/cpvt_section.h" +#include "core/fpdfdoc/cpvt_word.h" #include "core/fxge/include/fx_font.h" #include "fpdfsdk/fxedit/include/fxet_edit.h" #include "fpdfsdk/pdfwindow/PWL_Caret.h" diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/pdfwindow/PWL_FontMap.cpp index 6b719606a7..57feb27dcd 100644 --- a/fpdfsdk/pdfwindow/PWL_FontMap.cpp +++ b/fpdfsdk/pdfwindow/PWL_FontMap.cpp @@ -11,7 +11,7 @@ #include "core/fpdfapi/fpdf_font/cpdf_fontencoding.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/cpdf_parser.h" -#include "core/fpdfdoc/include/ipvt_fontmap.h" +#include "core/fpdfdoc/ipvt_fontmap.h" #include "fpdfsdk/pdfwindow/PWL_Wnd.h" namespace { diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.h b/fpdfsdk/pdfwindow/PWL_FontMap.h index bb3925d5c2..3dcd33919f 100644 --- a/fpdfsdk/pdfwindow/PWL_FontMap.h +++ b/fpdfsdk/pdfwindow/PWL_FontMap.h @@ -9,7 +9,7 @@ #include -#include "core/fpdfdoc/include/ipvt_fontmap.h" +#include "core/fpdfdoc/ipvt_fontmap.h" #include "core/fxge/include/fx_font.h" #include "fpdfsdk/fxedit/include/fx_edit.h" #include "public/fpdf_sysfontinfo.h" diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp index 7c7e05af00..4b19fd5927 100644 --- a/fpdfsdk/pdfwindow/PWL_Utils.cpp +++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp @@ -8,7 +8,7 @@ #include -#include "core/fpdfdoc/include/cpvt_word.h" +#include "core/fpdfdoc/cpvt_word.h" #include "core/fxge/include/cfx_graphstatedata.h" #include "core/fxge/include/cfx_pathdata.h" #include "core/fxge/include/cfx_renderdevice.h" diff --git a/fpdfsdk/pdfwindow/PWL_Utils.h b/fpdfsdk/pdfwindow/PWL_Utils.h index d7c65d2a8a..bdcba968a6 100644 --- a/fpdfsdk/pdfwindow/PWL_Utils.h +++ b/fpdfsdk/pdfwindow/PWL_Utils.h @@ -7,7 +7,7 @@ #ifndef FPDFSDK_PDFWINDOW_PWL_UTILS_H_ #define FPDFSDK_PDFWINDOW_PWL_UTILS_H_ -#include "core/fpdfdoc/include/cpvt_wordrange.h" +#include "core/fpdfdoc/cpvt_wordrange.h" #include "fpdfsdk/pdfwindow/PWL_Wnd.h" class CFX_Edit; diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.h b/fpdfsdk/pdfwindow/PWL_Wnd.h index ca2b4c77da..37209ed8f8 100644 --- a/fpdfsdk/pdfwindow/PWL_Wnd.h +++ b/fpdfsdk/pdfwindow/PWL_Wnd.h @@ -10,7 +10,7 @@ #include #include -#include "core/fpdfdoc/include/cpdf_formcontrol.h" +#include "core/fpdfdoc/cpdf_formcontrol.h" #include "core/fxcrt/include/fx_basic.h" #include "fpdfsdk/cfx_systemhandler.h" diff --git a/xfa/fxfa/app/DEPS b/xfa/fxfa/app/DEPS index 5943f04098..abdf53d98f 100644 --- a/xfa/fxfa/app/DEPS +++ b/xfa/fxfa/app/DEPS @@ -3,7 +3,7 @@ include_rules = [ '+core/fpdfapi/fpdf_font', '+core/fpdfapi/fpdf_page', '+core/fpdfapi/fpdf_parser', - '+core/fpdfdoc/include', + '+core/fpdfdoc', '+core/fxcodec/include', '+core/fxcodec/codec/include', ] diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp index a36e5e022e..f9b92c6f6d 100644 --- a/xfa/fxfa/app/xfa_ffdoc.cpp +++ b/xfa/fxfa/app/xfa_ffdoc.cpp @@ -11,7 +11,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" -#include "core/fpdfdoc/include/cpdf_nametree.h" +#include "core/fpdfdoc/cpdf_nametree.h" #include "core/fxcrt/include/fx_ext.h" #include "core/fxcrt/include/fx_memory.h" #include "xfa/fde/xml/fde_xml_imp.h" -- cgit v1.2.3