From 74a34fc71ab02400a4c958709138302a1ab4c0e7 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 29 Sep 2016 16:41:42 -0700 Subject: Move core/fxge/include to core/fxge BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2377393002 --- BUILD.gn | 38 +- core/fpdfapi/cpdf_pagerendercontext.cpp | 2 +- core/fpdfapi/fpdf_font/cpdf_font.cpp | 2 +- core/fpdfapi/fpdf_font/cpdf_font.h | 2 +- core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp | 2 +- core/fpdfapi/fpdf_font/cpdf_simplefont.cpp | 2 +- core/fpdfapi/fpdf_font/cpdf_truetypefont.cpp | 2 +- core/fpdfapi/fpdf_font/cpdf_type1font.cpp | 4 +- core/fpdfapi/fpdf_font/cpdf_type3char.cpp | 2 +- core/fpdfapi/fpdf_font/fpdf_font.cpp | 2 +- core/fpdfapi/fpdf_font/fpdf_font_cid.cpp | 2 +- core/fpdfapi/fpdf_font/ttgsubtable.cpp | 2 +- core/fpdfapi/fpdf_font/ttgsubtable.h | 4 +- core/fpdfapi/fpdf_page/cpdf_allstates.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_colorstate.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_generalstate.h | 2 +- core/fpdfapi/fpdf_page/cpdf_graphicstates.h | 2 +- core/fpdfapi/fpdf_page/cpdf_image.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_path.h | 6 +- core/fpdfapi/fpdf_page/fpdf_page_parser.cpp | 4 +- core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp | 4 +- core/fpdfapi/fpdf_page/pageint.h | 4 +- core/fpdfapi/fpdf_parser/cpdf_document.cpp | 4 +- core/fpdfapi/fpdf_render/cpdf_renderoptions.h | 2 +- core/fpdfapi/fpdf_render/cpdf_textrenderer.h | 2 +- core/fpdfapi/fpdf_render/cpdf_type3cache.cpp | 4 +- core/fpdfapi/fpdf_render/cpdf_type3glyphs.cpp | 2 +- core/fpdfapi/fpdf_render/fpdf_render.cpp | 8 +- core/fpdfapi/fpdf_render/fpdf_render_image.cpp | 4 +- core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp | 8 +- core/fpdfapi/fpdf_render/fpdf_render_text.cpp | 12 +- core/fpdfapi/fpdf_render/render_int.h | 4 +- core/fpdfdoc/cpdf_annot.cpp | 6 +- core/fpdfdoc/cpdf_annotlist.cpp | 2 +- core/fpdfdoc/cpdf_apsettings.h | 2 +- core/fpdfdoc/cpdf_bookmark.cpp | 2 +- core/fpdfdoc/cpdf_defaultappearance.h | 2 +- core/fpdfdoc/cpdf_formcontrol.cpp | 2 +- core/fpdfdoc/cpdf_formcontrol.h | 2 +- core/fpdfdoc/cpdf_interform.cpp | 4 +- core/fpdfdoc/cpdf_variabletext.h | 2 +- core/fpdfdoc/cpvt_wordprops.h | 2 +- core/fpdfdoc/fpdf_tagged.h | 2 +- core/fxcodec/codec/ccodec_progressivedecoder.h | 2 +- core/fxcodec/codec/fx_codec_bmp.cpp | 2 +- core/fxcodec/codec/fx_codec_gif.cpp | 2 +- core/fxcodec/codec/fx_codec_jpeg.cpp | 2 +- core/fxcodec/codec/fx_codec_png.cpp | 2 +- core/fxcodec/codec/fx_codec_progress.cpp | 2 +- core/fxcodec/codec/fx_codec_tiff.cpp | 2 +- core/fxge/agg/fx_agg_driver.cpp | 12 +- core/fxge/agg/fx_agg_driver.h | 2 +- core/fxge/android/fpf_skiafont.cpp | 2 +- core/fxge/android/fpf_skiafont.h | 2 +- core/fxge/android/fpf_skiafontmgr.cpp | 2 +- core/fxge/android/fpf_skiafontmgr.h | 2 +- core/fxge/android/fx_android_font.cpp | 2 +- core/fxge/android/fx_android_font.h | 6 +- core/fxge/android/fx_android_imp.cpp | 2 +- core/fxge/apple/apple_int.h | 10 +- core/fxge/apple/cfx_quartzdevice.h | 2 +- core/fxge/apple/fx_apple_platform.cpp | 8 +- core/fxge/apple/fx_mac_imp.cpp | 4 +- core/fxge/apple/fx_quartz_device.cpp | 10 +- core/fxge/cfx_facecache.h | 64 ++ core/fxge/cfx_fontcache.h | 42 ++ core/fxge/cfx_fontmapper.h | 84 +++ core/fxge/cfx_fontmgr.h | 69 +++ core/fxge/cfx_fxgedevice.h | 46 ++ core/fxge/cfx_gemodule.h | 50 ++ core/fxge/cfx_graphstate.h | 44 ++ core/fxge/cfx_graphstatedata.h | 38 ++ core/fxge/cfx_pathdata.h | 56 ++ core/fxge/cfx_renderdevice.h | 258 ++++++++ core/fxge/cfx_substfont.h | 34 ++ core/fxge/cfx_unicodeencoding.h | 46 ++ core/fxge/cfx_unicodeencodingex.h | 37 ++ core/fxge/cfx_windowsdevice.h | 39 ++ core/fxge/dib/dib_int.h | 2 +- core/fxge/dib/fx_dib_composite.cpp | 2 +- core/fxge/dib/fx_dib_convert.cpp | 2 +- core/fxge/dib/fx_dib_engine.cpp | 2 +- core/fxge/dib/fx_dib_engine_unittest.cpp | 2 +- core/fxge/dib/fx_dib_main.cpp | 4 +- core/fxge/dib/fx_dib_transform.cpp | 2 +- core/fxge/freetype/fx_freetype.cpp | 2 +- core/fxge/fx_dib.h | 680 ++++++++++++++++++++++ core/fxge/fx_font.h | 248 ++++++++ core/fxge/fx_freetype.h | 180 ++++++ core/fxge/ge/cfx_cliprgn.h | 2 +- core/fxge/ge/cfx_facecache.cpp | 12 +- core/fxge/ge/cfx_folderfontinfo.cpp | 4 +- core/fxge/ge/cfx_folderfontinfo.h | 6 +- core/fxge/ge/cfx_font.cpp | 16 +- core/fxge/ge/cfx_fontcache.cpp | 8 +- core/fxge/ge/cfx_fontmapper.cpp | 8 +- core/fxge/ge/cfx_fontmgr.cpp | 10 +- core/fxge/ge/cfx_gemodule.cpp | 6 +- core/fxge/ge/cfx_graphstate.cpp | 2 +- core/fxge/ge/cfx_graphstatedata.cpp | 2 +- core/fxge/ge/cfx_pathdata.cpp | 2 +- core/fxge/ge/cfx_renderdevice.cpp | 12 +- core/fxge/ge/cfx_substfont.cpp | 4 +- core/fxge/ge/cfx_unicodeencoding.cpp | 6 +- core/fxge/ge/cfx_unicodeencodingex.cpp | 6 +- core/fxge/ge/cttfontdesc.cpp | 2 +- core/fxge/ge/cttfontdesc.h | 2 +- core/fxge/ge/fx_ge_fontmap.cpp | 4 +- core/fxge/ge/fx_ge_linux.cpp | 4 +- core/fxge/ge/fx_ge_text.cpp | 6 +- core/fxge/ge/fx_text_int.h | 4 +- core/fxge/ifx_renderdevicedriver.cpp | 6 +- core/fxge/ifx_renderdevicedriver.h | 108 ++++ core/fxge/ifx_systemfontinfo.h | 49 ++ core/fxge/include/cfx_facecache.h | 64 -- core/fxge/include/cfx_fontcache.h | 42 -- core/fxge/include/cfx_fontmapper.h | 84 --- core/fxge/include/cfx_fontmgr.h | 69 --- core/fxge/include/cfx_fxgedevice.h | 46 -- core/fxge/include/cfx_gemodule.h | 50 -- core/fxge/include/cfx_graphstate.h | 44 -- core/fxge/include/cfx_graphstatedata.h | 38 -- core/fxge/include/cfx_pathdata.h | 56 -- core/fxge/include/cfx_renderdevice.h | 258 -------- core/fxge/include/cfx_substfont.h | 34 -- core/fxge/include/cfx_unicodeencoding.h | 46 -- core/fxge/include/cfx_unicodeencodingex.h | 37 -- core/fxge/include/cfx_windowsdevice.h | 39 -- core/fxge/include/fx_dib.h | 680 ---------------------- core/fxge/include/fx_font.h | 248 -------- core/fxge/include/fx_freetype.h | 180 ------ core/fxge/include/ifx_renderdevicedriver.h | 108 ---- core/fxge/include/ifx_systemfontinfo.h | 49 -- core/fxge/skia/fx_skia_device.cpp | 10 +- core/fxge/skia/fx_skia_device.h | 4 +- core/fxge/skia/fx_skia_device_unittest.cpp | 8 +- core/fxge/win32/fx_win32_device.cpp | 16 +- core/fxge/win32/fx_win32_dib.cpp | 2 +- core/fxge/win32/fx_win32_gdipext.cpp | 6 +- core/fxge/win32/fx_win32_print.cpp | 6 +- core/fxge/win32/win32_int.h | 4 +- fpdfsdk/DEPS | 2 +- fpdfsdk/cfx_systemhandler.cpp | 6 +- fpdfsdk/cpdfsdk_interform.cpp | 6 +- fpdfsdk/cpdfsdk_widget.cpp | 6 +- fpdfsdk/formfiller/cba_fontmap.cpp | 2 +- fpdfsdk/formfiller/cffl_formfiller.cpp | 2 +- fpdfsdk/formfiller/cffl_interactiveformfiller.cpp | 6 +- fpdfsdk/fpdf_progressive.cpp | 4 +- fpdfsdk/fpdf_sysfontinfo.cpp | 8 +- fpdfsdk/fpdf_transformpage.cpp | 2 +- fpdfsdk/fpdfformfill.cpp | 2 +- fpdfsdk/fpdfview.cpp | 6 +- fpdfsdk/fxedit/fxet_edit.cpp | 6 +- fpdfsdk/include/cpdfsdk_interform.h | 2 +- fpdfsdk/include/fsdk_define.h | 2 +- fpdfsdk/pdfwindow/PWL_Caret.cpp | 6 +- fpdfsdk/pdfwindow/PWL_ComboBox.cpp | 4 +- fpdfsdk/pdfwindow/PWL_Edit.cpp | 8 +- fpdfsdk/pdfwindow/PWL_EditCtrl.cpp | 2 +- fpdfsdk/pdfwindow/PWL_FontMap.h | 2 +- fpdfsdk/pdfwindow/PWL_ScrollBar.cpp | 4 +- fpdfsdk/pdfwindow/PWL_Utils.cpp | 6 +- xfa/DEPS | 2 +- xfa/fde/cfde_path.h | 4 +- xfa/fde/css/fde_css.h | 2 +- xfa/fde/fde_gedevice.cpp | 8 +- xfa/fde/fde_gedevice.h | 2 +- xfa/fde/fde_object.h | 2 +- xfa/fde/fde_visualset.h | 2 +- xfa/fde/ifde_txtedtengine.h | 2 +- xfa/fde/tto/fde_textout.h | 6 +- xfa/fgas/font/fgas_font.h | 2 +- xfa/fgas/font/fgas_gefont.cpp | 6 +- xfa/fgas/font/fgas_stdfontmgr.cpp | 8 +- xfa/fgas/font/fgas_stdfontmgr.h | 6 +- xfa/fgas/layout/fgas_textbreak.h | 2 +- xfa/fwl/basewidget/cfx_barcode.h | 2 +- xfa/fwl/core/cfwl_themebackground.h | 2 +- xfa/fwl/theme/cfwl_arrowdata.h | 2 +- xfa/fwl/theme/cfwl_checkboxtp.cpp | 2 +- xfa/fxbarcode/BC_TwoDimWriter.cpp | 6 +- xfa/fxbarcode/BC_Writer.h | 2 +- xfa/fxbarcode/cbc_codabar.h | 2 +- xfa/fxbarcode/cbc_code128.h | 2 +- xfa/fxbarcode/cbc_code39.h | 2 +- xfa/fxbarcode/cbc_codebase.h | 2 +- xfa/fxbarcode/cbc_datamatrix.h | 2 +- xfa/fxbarcode/cbc_ean13.h | 2 +- xfa/fxbarcode/cbc_ean8.h | 2 +- xfa/fxbarcode/cbc_pdf417i.h | 2 +- xfa/fxbarcode/cbc_qrcode.h | 2 +- xfa/fxbarcode/cbc_upca.h | 2 +- xfa/fxbarcode/oned/BC_OneDimWriter.cpp | 12 +- xfa/fxbarcode/oned/BC_OneDimWriter.h | 2 +- xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp | 4 +- xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp | 4 +- xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp | 4 +- xfa/fxfa/app/xfa_ffwidget.cpp | 6 +- xfa/fxfa/include/fxfa_widget.h | 2 +- xfa/fxfa/include/xfa_ffwidget.h | 2 +- xfa/fxfa/parser/cxfa_data.h | 2 +- xfa/fxfa/parser/cxfa_fill.h | 2 +- xfa/fxfa/parser/cxfa_font.cpp | 2 +- xfa/fxfa/parser/cxfa_font.h | 2 +- xfa/fxfa/parser/cxfa_stroke.h | 2 +- xfa/fxfa/parser/xfa_localemgr.cpp | 2 +- xfa/fxgraphics/cagg_graphics.h | 2 +- xfa/fxgraphics/cfx_color.h | 2 +- xfa/fxgraphics/cfx_graphics.cpp | 8 +- xfa/fxgraphics/cfx_path.cpp | 2 +- xfa/fxgraphics/cfx_path_generator.cpp | 4 +- xfa/fxgraphics/cfx_path_generator.h | 2 +- xfa/fxgraphics/cfx_shading.h | 2 +- xfa/fxgraphics/include/cfx_graphics.h | 10 +- 215 files changed, 2534 insertions(+), 2534 deletions(-) create mode 100644 core/fxge/cfx_facecache.h create mode 100644 core/fxge/cfx_fontcache.h create mode 100644 core/fxge/cfx_fontmapper.h create mode 100644 core/fxge/cfx_fontmgr.h create mode 100644 core/fxge/cfx_fxgedevice.h create mode 100644 core/fxge/cfx_gemodule.h create mode 100644 core/fxge/cfx_graphstate.h create mode 100644 core/fxge/cfx_graphstatedata.h create mode 100644 core/fxge/cfx_pathdata.h create mode 100644 core/fxge/cfx_renderdevice.h create mode 100644 core/fxge/cfx_substfont.h create mode 100644 core/fxge/cfx_unicodeencoding.h create mode 100644 core/fxge/cfx_unicodeencodingex.h create mode 100644 core/fxge/cfx_windowsdevice.h create mode 100644 core/fxge/fx_dib.h create mode 100644 core/fxge/fx_font.h create mode 100644 core/fxge/fx_freetype.h create mode 100644 core/fxge/ifx_renderdevicedriver.h create mode 100644 core/fxge/ifx_systemfontinfo.h delete mode 100644 core/fxge/include/cfx_facecache.h delete mode 100644 core/fxge/include/cfx_fontcache.h delete mode 100644 core/fxge/include/cfx_fontmapper.h delete mode 100644 core/fxge/include/cfx_fontmgr.h delete mode 100644 core/fxge/include/cfx_fxgedevice.h delete mode 100644 core/fxge/include/cfx_gemodule.h delete mode 100644 core/fxge/include/cfx_graphstate.h delete mode 100644 core/fxge/include/cfx_graphstatedata.h delete mode 100644 core/fxge/include/cfx_pathdata.h delete mode 100644 core/fxge/include/cfx_renderdevice.h delete mode 100644 core/fxge/include/cfx_substfont.h delete mode 100644 core/fxge/include/cfx_unicodeencoding.h delete mode 100644 core/fxge/include/cfx_unicodeencodingex.h delete mode 100644 core/fxge/include/cfx_windowsdevice.h delete mode 100644 core/fxge/include/fx_dib.h delete mode 100644 core/fxge/include/fx_font.h delete mode 100644 core/fxge/include/fx_freetype.h delete mode 100644 core/fxge/include/ifx_renderdevicedriver.h delete mode 100644 core/fxge/include/ifx_systemfontinfo.h diff --git a/BUILD.gn b/BUILD.gn index 0c3bd09f42..315eaa207e 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -758,6 +758,19 @@ static_library("fxge") { "core/fxge/apple/cfx_quartzdevice.h", "core/fxge/apple/fx_mac_imp.cpp", "core/fxge/apple/fx_quartz_device.cpp", + "core/fxge/cfx_facecache.h", + "core/fxge/cfx_fontcache.h", + "core/fxge/cfx_fontmapper.h", + "core/fxge/cfx_fontmgr.h", + "core/fxge/cfx_fxgedevice.h", + "core/fxge/cfx_gemodule.h", + "core/fxge/cfx_graphstate.h", + "core/fxge/cfx_graphstatedata.h", + "core/fxge/cfx_pathdata.h", + "core/fxge/cfx_renderdevice.h", + "core/fxge/cfx_substfont.h", + "core/fxge/cfx_unicodeencoding.h", + "core/fxge/cfx_windowsdevice.h", "core/fxge/dib/dib_int.h", "core/fxge/dib/fx_dib_composite.cpp", "core/fxge/dib/fx_dib_convert.cpp", @@ -782,6 +795,9 @@ static_library("fxge") { "core/fxge/fontdata/chromefontdata/FoxitSymbol.cpp", "core/fxge/fontdata/chromefontdata/chromefontdata.h", "core/fxge/freetype/fx_freetype.cpp", + "core/fxge/fx_dib.h", + "core/fxge/fx_font.h", + "core/fxge/fx_freetype.h", "core/fxge/ge/cfx_cliprgn.cpp", "core/fxge/ge/cfx_cliprgn.h", "core/fxge/ge/cfx_facecache.cpp", @@ -805,24 +821,8 @@ static_library("fxge") { "core/fxge/ge/fx_ge_text.cpp", "core/fxge/ge/fx_text_int.h", "core/fxge/ifx_renderdevicedriver.cpp", - "core/fxge/include/cfx_facecache.h", - "core/fxge/include/cfx_fontcache.h", - "core/fxge/include/cfx_fontmapper.h", - "core/fxge/include/cfx_fontmgr.h", - "core/fxge/include/cfx_fxgedevice.h", - "core/fxge/include/cfx_gemodule.h", - "core/fxge/include/cfx_graphstate.h", - "core/fxge/include/cfx_graphstatedata.h", - "core/fxge/include/cfx_pathdata.h", - "core/fxge/include/cfx_renderdevice.h", - "core/fxge/include/cfx_substfont.h", - "core/fxge/include/cfx_unicodeencoding.h", - "core/fxge/include/cfx_windowsdevice.h", - "core/fxge/include/fx_dib.h", - "core/fxge/include/fx_font.h", - "core/fxge/include/fx_freetype.h", - "core/fxge/include/ifx_renderdevicedriver.h", - "core/fxge/include/ifx_systemfontinfo.h", + "core/fxge/ifx_renderdevicedriver.h", + "core/fxge/ifx_systemfontinfo.h", "core/fxge/win32/cfx_windowsdib.h", ] @@ -837,8 +837,8 @@ static_library("fxge") { if (pdf_enable_xfa) { sources += [ + "core/fxge/cfx_unicodeencodingex.h", "core/fxge/ge/cfx_unicodeencodingex.cpp", - "core/fxge/include/cfx_unicodeencodingex.h", ] } diff --git a/core/fpdfapi/cpdf_pagerendercontext.cpp b/core/fpdfapi/cpdf_pagerendercontext.cpp index e9a6f54aa2..dc5836262e 100644 --- a/core/fpdfapi/cpdf_pagerendercontext.cpp +++ b/core/fpdfapi/cpdf_pagerendercontext.cpp @@ -11,7 +11,7 @@ #include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" #include "core/fpdfdoc/cpdf_annotlist.h" #include "core/fpdfdoc/cpdf_occontext.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_renderdevice.h" CPDF_PageRenderContext::CPDF_PageRenderContext() {} diff --git a/core/fpdfapi/fpdf_font/cpdf_font.cpp b/core/fpdfapi/fpdf_font/cpdf_font.cpp index fd9a666d03..9b6fc5e824 100644 --- a/core/fpdfapi/fpdf_font/cpdf_font.cpp +++ b/core/fpdfapi/fpdf_font/cpdf_font.cpp @@ -23,7 +23,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_name.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h" #include "core/fxcrt/fx_memory.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_freetype.h" #include "third_party/base/stl_util.h" namespace { diff --git a/core/fpdfapi/fpdf_font/cpdf_font.h b/core/fpdfapi/fpdf_font/cpdf_font.h index 00fcfd7ddd..04f942c03c 100644 --- a/core/fpdfapi/fpdf_font/cpdf_font.h +++ b/core/fpdfapi/fpdf_font/cpdf_font.h @@ -12,7 +12,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_font.h" #define PDFFONT_FIXEDPITCH 1 #define PDFFONT_SERIF 2 diff --git a/core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp b/core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp index 8704aea365..e373e01233 100644 --- a/core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp +++ b/core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp @@ -11,7 +11,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_name.h" #include "core/fpdfapi/fpdf_parser/cpdf_number.h" #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_freetype.h" namespace { diff --git a/core/fpdfapi/fpdf_font/cpdf_simplefont.cpp b/core/fpdfapi/fpdf_font/cpdf_simplefont.cpp index 94d8a993b7..dda642380f 100644 --- a/core/fpdfapi/fpdf_font/cpdf_simplefont.cpp +++ b/core/fpdfapi/fpdf_font/cpdf_simplefont.cpp @@ -9,7 +9,7 @@ #include "core/fpdfapi/fpdf_font/font_int.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_freetype.h" #include "third_party/base/numerics/safe_math.h" CPDF_SimpleFont::CPDF_SimpleFont() : m_BaseEncoding(PDFFONT_ENCODING_BUILTIN) { diff --git a/core/fpdfapi/fpdf_font/cpdf_truetypefont.cpp b/core/fpdfapi/fpdf_font/cpdf_truetypefont.cpp index c6b8eb6419..08c3e11974 100644 --- a/core/fpdfapi/fpdf_font/cpdf_truetypefont.cpp +++ b/core/fpdfapi/fpdf_font/cpdf_truetypefont.cpp @@ -8,7 +8,7 @@ #include "core/fpdfapi/fpdf_font/font_int.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_font.h" namespace { diff --git a/core/fpdfapi/fpdf_font/cpdf_type1font.cpp b/core/fpdfapi/fpdf_font/cpdf_type1font.cpp index 04b872f0e0..d80d59ae9d 100644 --- a/core/fpdfapi/fpdf_font/cpdf_type1font.cpp +++ b/core/fpdfapi/fpdf_font/cpdf_type1font.cpp @@ -8,8 +8,8 @@ #include "core/fpdfapi/fpdf_font/font_int.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/fx_freetype.h" #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ #include "core/fxge/apple/apple_int.h" diff --git a/core/fpdfapi/fpdf_font/cpdf_type3char.cpp b/core/fpdfapi/fpdf_font/cpdf_type3char.cpp index c97e26d76b..a11f319b78 100644 --- a/core/fpdfapi/fpdf_font/cpdf_type3char.cpp +++ b/core/fpdfapi/fpdf_font/cpdf_type3char.cpp @@ -10,7 +10,7 @@ #include "core/fpdfapi/fpdf_page/cpdf_image.h" #include "core/fpdfapi/fpdf_page/cpdf_imageobject.h" #include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm) : m_pForm(pForm), m_bColored(FALSE) {} diff --git a/core/fpdfapi/fpdf_font/fpdf_font.cpp b/core/fpdfapi/fpdf_font/fpdf_font.cpp index 722e74dde5..cff5223a00 100644 --- a/core/fpdfapi/fpdf_font/fpdf_font.cpp +++ b/core/fpdfapi/fpdf_font/fpdf_font.cpp @@ -18,7 +18,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_simple_parser.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h" #include "core/fxcrt/fx_ext.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_freetype.h" #include "third_party/base/numerics/safe_conversions.h" #include "third_party/base/stl_util.h" diff --git a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp index 891ca7f9ea..abedcf0708 100644 --- a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp +++ b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp @@ -14,7 +14,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/cpdf_simple_parser.h" #include "core/fxcrt/fx_ext.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_freetype.h" namespace { diff --git a/core/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/fpdfapi/fpdf_font/ttgsubtable.cpp index fb6287ee28..dde7793050 100644 --- a/core/fpdfapi/fpdf_font/ttgsubtable.cpp +++ b/core/fpdfapi/fpdf_font/ttgsubtable.cpp @@ -6,7 +6,7 @@ #include "core/fpdfapi/fpdf_font/ttgsubtable.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_freetype.h" #include "third_party/base/stl_util.h" CFX_GlyphMap::CFX_GlyphMap() {} diff --git a/core/fpdfapi/fpdf_font/ttgsubtable.h b/core/fpdfapi/fpdf_font/ttgsubtable.h index 759eea4036..492a6a21de 100644 --- a/core/fpdfapi/fpdf_font/ttgsubtable.h +++ b/core/fpdfapi/fpdf_font/ttgsubtable.h @@ -13,8 +13,8 @@ #include #include "core/fxcrt/fx_basic.h" -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_font.h" +#include "core/fxge/fx_freetype.h" class CFX_GlyphMap { public: diff --git a/core/fpdfapi/fpdf_page/cpdf_allstates.cpp b/core/fpdfapi/fpdf_page/cpdf_allstates.cpp index 24ec15f3c1..16eb0dfbae 100644 --- a/core/fpdfapi/fpdf_page/cpdf_allstates.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_allstates.cpp @@ -9,7 +9,7 @@ #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" -#include "core/fxge/include/cfx_graphstatedata.h" +#include "core/fxge/cfx_graphstatedata.h" namespace { diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp b/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp index c6a5254c0f..e74b884d68 100644 --- a/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp @@ -8,7 +8,7 @@ #include "core/fpdfapi/fpdf_page/cpdf_pattern.h" #include "core/fpdfapi/fpdf_page/cpdf_tilingpattern.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" CPDF_ColorState::CPDF_ColorState() {} diff --git a/core/fpdfapi/fpdf_page/cpdf_generalstate.h b/core/fpdfapi/fpdf_page/cpdf_generalstate.h index 35562d9706..9bcce04894 100644 --- a/core/fpdfapi/fpdf_page/cpdf_generalstate.h +++ b/core/fpdfapi/fpdf_page/cpdf_generalstate.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_basic.h" #include "core/fxcrt/fx_coordinates.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" class CPDF_Object; class CPDF_TransferFunc; diff --git a/core/fpdfapi/fpdf_page/cpdf_graphicstates.h b/core/fpdfapi/fpdf_page/cpdf_graphicstates.h index f52aba27d8..6e612153d0 100644 --- a/core/fpdfapi/fpdf_page/cpdf_graphicstates.h +++ b/core/fpdfapi/fpdf_page/cpdf_graphicstates.h @@ -11,7 +11,7 @@ #include "core/fpdfapi/fpdf_page/cpdf_colorstate.h" #include "core/fpdfapi/fpdf_page/cpdf_generalstate.h" #include "core/fpdfapi/fpdf_page/cpdf_textstate.h" -#include "core/fxge/include/cfx_graphstate.h" +#include "core/fxge/cfx_graphstate.h" class CPDF_GraphicStates { public: diff --git a/core/fpdfapi/fpdf_page/cpdf_image.cpp b/core/fpdfapi/fpdf_page/cpdf_image.cpp index 5a1f9af037..21cec2e442 100644 --- a/core/fpdfapi/fpdf_page/cpdf_image.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_image.cpp @@ -20,7 +20,7 @@ #include "core/fpdfapi/fpdf_render/cpdf_pagerendercache.h" #include "core/fpdfapi/fpdf_render/render_int.h" #include "core/fxcodec/fx_codec.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" CPDF_Image::CPDF_Image(CPDF_Document* pDoc) : CPDF_Image(pDoc, nullptr, false) {} diff --git a/core/fpdfapi/fpdf_page/cpdf_path.h b/core/fpdfapi/fpdf_page/cpdf_path.h index b4450c171e..3f77b05d5b 100644 --- a/core/fpdfapi/fpdf_page/cpdf_path.h +++ b/core/fpdfapi/fpdf_page/cpdf_path.h @@ -9,9 +9,9 @@ #include "core/fxcrt/cfx_count_ref.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" class CPDF_Path { public: diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp index 41fefa0580..18a2e2d882 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp @@ -34,8 +34,8 @@ #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h" #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" #include "core/fxcrt/fx_safe_types.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" namespace { diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp index 68c6eca210..3c7a301d29 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp @@ -30,8 +30,8 @@ #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_ext.h" #include "core/fxcrt/fx_safe_types.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_renderdevice.h" namespace { diff --git a/core/fpdfapi/fpdf_page/pageint.h b/core/fpdfapi/fpdf_page/pageint.h index 2fbc629136..3c10702b9e 100644 --- a/core/fpdfapi/fpdf_page/pageint.h +++ b/core/fpdfapi/fpdf_page/pageint.h @@ -18,8 +18,8 @@ #include "core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h" #include "core/fxcrt/cfx_string_pool_template.h" #include "core/fxcrt/cfx_weak_ptr.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" class CPDF_AllStates; class CPDF_ColorSpace; diff --git a/core/fpdfapi/fpdf_parser/cpdf_document.cpp b/core/fpdfapi/fpdf_parser/cpdf_document.cpp index 30a50f54ae..f90fa3dc78 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_document.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_document.cpp @@ -21,8 +21,8 @@ #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" #include "core/fpdfapi/fpdf_render/render_int.h" #include "core/fxcodec/JBig2_DocumentContext.h" -#include "core/fxge/include/cfx_unicodeencoding.h" -#include "core/fxge/include/fx_font.h" +#include "core/fxge/cfx_unicodeencoding.h" +#include "core/fxge/fx_font.h" #include "third_party/base/stl_util.h" namespace { diff --git a/core/fpdfapi/fpdf_render/cpdf_renderoptions.h b/core/fpdfapi/fpdf_render/cpdf_renderoptions.h index 73383ae8f0..bb0bcd3651 100644 --- a/core/fpdfapi/fpdf_render/cpdf_renderoptions.h +++ b/core/fpdfapi/fpdf_render/cpdf_renderoptions.h @@ -8,7 +8,7 @@ #define CORE_FPDFAPI_FPDF_RENDER_CPDF_RENDEROPTIONS_H_ #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" class CPDF_OCContext; diff --git a/core/fpdfapi/fpdf_render/cpdf_textrenderer.h b/core/fpdfapi/fpdf_render/cpdf_textrenderer.h index ca6d91efe6..b758a01570 100644 --- a/core/fpdfapi/fpdf_render/cpdf_textrenderer.h +++ b/core/fpdfapi/fpdf_render/cpdf_textrenderer.h @@ -10,7 +10,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" class CFX_RenderDevice; class CFX_GraphStateData; diff --git a/core/fpdfapi/fpdf_render/cpdf_type3cache.cpp b/core/fpdfapi/fpdf_render/cpdf_type3cache.cpp index a1856ba5e1..6de46a6376 100644 --- a/core/fpdfapi/fpdf_render/cpdf_type3cache.cpp +++ b/core/fpdfapi/fpdf_render/cpdf_type3cache.cpp @@ -12,8 +12,8 @@ #include "core/fpdfapi/fpdf_font/cpdf_type3char.h" #include "core/fpdfapi/fpdf_font/cpdf_type3font.h" #include "core/fpdfapi/fpdf_render/cpdf_type3glyphs.h" -#include "core/fxge/include/fx_dib.h" -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_dib.h" +#include "core/fxge/fx_font.h" namespace { diff --git a/core/fpdfapi/fpdf_render/cpdf_type3glyphs.cpp b/core/fpdfapi/fpdf_render/cpdf_type3glyphs.cpp index f450dffa8c..e811c2bd8c 100644 --- a/core/fpdfapi/fpdf_render/cpdf_type3glyphs.cpp +++ b/core/fpdfapi/fpdf_render/cpdf_type3glyphs.cpp @@ -8,7 +8,7 @@ #include -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_font.h" CPDF_Type3Glyphs::CPDF_Type3Glyphs() : m_TopBlueCount(0), m_BottomBlueCount(0) {} diff --git a/core/fpdfapi/fpdf_render/fpdf_render.cpp b/core/fpdfapi/fpdf_render/fpdf_render.cpp index d610670fd5..a87a40afae 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render.cpp @@ -30,10 +30,10 @@ #include "core/fpdfapi/fpdf_render/cpdf_textrenderer.h" #include "core/fpdfapi/fpdf_render/cpdf_type3cache.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" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" CPDF_DocRenderData::CPDF_DocRenderData(CPDF_Document* pPDFDoc) : m_pPDFDoc(pPDFDoc) {} diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp index 1b7b7db575..d0bca1a17a 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -26,8 +26,8 @@ #include "core/fpdfdoc/cpdf_occontext.h" #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_safe_types.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_pathdata.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_pathdata.h" #ifdef _SKIA_SUPPORT_ #include "core/fxge/skia/fx_skia_device.h" diff --git a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp index b31ae211ab..55887204ef 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp @@ -21,10 +21,10 @@ #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_render/cpdf_rendercontext.h" #include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/ifx_renderdevicedriver.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" +#include "core/fxge/ifx_renderdevicedriver.h" namespace { diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp index 0f4becf240..1ddf954d86 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp @@ -23,12 +23,12 @@ #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/fxge/include/cfx_facecache.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_facecache.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" FX_BOOL CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj, const CFX_Matrix* pObj2Device, diff --git a/core/fpdfapi/fpdf_render/render_int.h b/core/fpdfapi/fpdf_render/render_int.h index b193344ca5..c913d56a7f 100644 --- a/core/fpdfapi/fpdf_render/render_int.h +++ b/core/fpdfapi/fpdf_render/render_int.h @@ -16,8 +16,8 @@ #include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h" #include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_renderdevice.h" class CCodec_Jbig2Context; class CCodec_ScanlineDecoder; diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp index ed43e5bab8..3df5ca5144 100644 --- a/core/fpdfdoc/cpdf_annot.cpp +++ b/core/fpdfdoc/cpdf_annot.cpp @@ -14,9 +14,9 @@ #include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" #include "core/fpdfdoc/cpvt_generateap.h" #include "core/fxcrt/fx_memory.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" namespace { diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp index d19f9b4b70..7ddbab38a6 100644 --- a/core/fpdfdoc/cpdf_annotlist.cpp +++ b/core/fpdfdoc/cpdf_annotlist.cpp @@ -14,7 +14,7 @@ #include "core/fpdfdoc/cpdf_interform.h" #include "core/fpdfdoc/cpdf_occontext.h" #include "core/fpdfdoc/cpvt_generateap.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_renderdevice.h" namespace { diff --git a/core/fpdfdoc/cpdf_apsettings.h b/core/fpdfdoc/cpdf_apsettings.h index b2ae2488a1..ffddffdbe0 100644 --- a/core/fpdfdoc/cpdf_apsettings.h +++ b/core/fpdfdoc/cpdf_apsettings.h @@ -10,7 +10,7 @@ #include "core/fpdfdoc/cpdf_iconfit.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" class CPDF_Dictionary; class CPDF_FormControl; diff --git a/core/fpdfdoc/cpdf_bookmark.cpp b/core/fpdfdoc/cpdf_bookmark.cpp index fb74567938..191a26df14 100644 --- a/core/fpdfdoc/cpdf_bookmark.cpp +++ b/core/fpdfdoc/cpdf_bookmark.cpp @@ -9,7 +9,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_string.h" #include "core/fpdfdoc/cpdf_nametree.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" uint32_t CPDF_Bookmark::GetColorRef() const { if (!m_pDict) diff --git a/core/fpdfdoc/cpdf_defaultappearance.h b/core/fpdfdoc/cpdf_defaultappearance.h index 70b1bd4583..4507f4f78f 100644 --- a/core/fpdfdoc/cpdf_defaultappearance.h +++ b/core/fpdfdoc/cpdf_defaultappearance.h @@ -11,7 +11,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" enum class BorderStyle { SOLID, DASH, BEVELED, INSET, UNDERLINE }; enum class PaintOperation { STROKE, FILL }; diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp index 82a416f942..dab59d773a 100644 --- a/core/fpdfdoc/cpdf_formcontrol.cpp +++ b/core/fpdfdoc/cpdf_formcontrol.cpp @@ -15,7 +15,7 @@ #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" #include "core/fpdfapi/fpdf_render/cpdf_rendercontext.h" #include "core/fpdfdoc/cpdf_interform.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_renderdevice.h" namespace { diff --git a/core/fpdfdoc/cpdf_formcontrol.h b/core/fpdfdoc/cpdf_formcontrol.h index 1ad79ee6f7..e86443402d 100644 --- a/core/fpdfdoc/cpdf_formcontrol.h +++ b/core/fpdfdoc/cpdf_formcontrol.h @@ -18,7 +18,7 @@ #include "core/fpdfdoc/ipdf_formnotify.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #define TEXTPOS_CAPTION 0 #define TEXTPOS_ICON 1 diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index 00fff1acb4..624bb45de4 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -16,8 +16,8 @@ #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 "core/fxge/cfx_substfont.h" +#include "core/fxge/fx_font.h" #include "third_party/base/stl_util.h" namespace { diff --git a/core/fpdfdoc/cpdf_variabletext.h b/core/fpdfdoc/cpdf_variabletext.h index e57636e821..21edc35b5b 100644 --- a/core/fpdfdoc/cpdf_variabletext.h +++ b/core/fpdfdoc/cpdf_variabletext.h @@ -18,7 +18,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_font.h" class CSection; class IPVT_FontMap; diff --git a/core/fpdfdoc/cpvt_wordprops.h b/core/fpdfdoc/cpvt_wordprops.h index ca95755dbd..2b7084116a 100644 --- a/core/fpdfdoc/cpvt_wordprops.h +++ b/core/fpdfdoc/cpvt_wordprops.h @@ -9,7 +9,7 @@ #include "core/fpdfdoc/cpdf_variabletext.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" struct CPVT_WordProps { CPVT_WordProps() diff --git a/core/fpdfdoc/fpdf_tagged.h b/core/fpdfdoc/fpdf_tagged.h index da05b79674..da382579ae 100644 --- a/core/fpdfdoc/fpdf_tagged.h +++ b/core/fpdfdoc/fpdf_tagged.h @@ -7,7 +7,7 @@ #ifndef CORE_FPDFDOC_FPDF_TAGGED_H_ #define CORE_FPDFDOC_FPDF_TAGGED_H_ -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" class CPDF_Dictionary; class CPDF_Document; diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h index e51d0739d2..73fec6457e 100644 --- a/core/fxcodec/codec/ccodec_progressivedecoder.h +++ b/core/fxcodec/codec/ccodec_progressivedecoder.h @@ -11,7 +11,7 @@ #include "core/fxcodec/fx_codec_def.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" class CCodec_BmpModule; class CCodec_GifContext; diff --git a/core/fxcodec/codec/fx_codec_bmp.cpp b/core/fxcodec/codec/fx_codec_bmp.cpp index c58aefbef7..45025a188f 100644 --- a/core/fxcodec/codec/fx_codec_bmp.cpp +++ b/core/fxcodec/codec/fx_codec_bmp.cpp @@ -7,7 +7,7 @@ #include "core/fxcodec/codec/codec_int.h" #include "core/fxcodec/fx_codec.h" #include "core/fxcodec/lbmp/fx_bmp.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" struct FXBMP_Context { bmp_decompress_struct_p bmp_ptr; void* parent_ptr; diff --git a/core/fxcodec/codec/fx_codec_gif.cpp b/core/fxcodec/codec/fx_codec_gif.cpp index f02dace23e..8a8d2dcdf5 100644 --- a/core/fxcodec/codec/fx_codec_gif.cpp +++ b/core/fxcodec/codec/fx_codec_gif.cpp @@ -7,7 +7,7 @@ #include "core/fxcodec/codec/codec_int.h" #include "core/fxcodec/fx_codec.h" #include "core/fxcodec/lgif/fx_gif.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" struct FXGIF_Context { gif_decompress_struct_p gif_ptr; void* parent_ptr; diff --git a/core/fxcodec/codec/fx_codec_jpeg.cpp b/core/fxcodec/codec/fx_codec_jpeg.cpp index 16e43f570c..7670516a25 100644 --- a/core/fxcodec/codec/fx_codec_jpeg.cpp +++ b/core/fxcodec/codec/fx_codec_jpeg.cpp @@ -9,7 +9,7 @@ #include "core/fxcodec/codec/codec_int.h" #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_safe_types.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" extern "C" { #undef FAR diff --git a/core/fxcodec/codec/fx_codec_png.cpp b/core/fxcodec/codec/fx_codec_png.cpp index bfbdf6c675..8630887a70 100644 --- a/core/fxcodec/codec/fx_codec_png.cpp +++ b/core/fxcodec/codec/fx_codec_png.cpp @@ -8,7 +8,7 @@ #include "core/fxcodec/codec/codec_int.h" #include "core/fxcodec/fx_codec.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" extern "C" { #undef FAR diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp index d468296acd..605e1b573f 100644 --- a/core/fxcodec/codec/fx_codec_progress.cpp +++ b/core/fxcodec/codec/fx_codec_progress.cpp @@ -9,7 +9,7 @@ #include #include "core/fxcodec/fx_codec.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "third_party/base/numerics/safe_math.h" #define FXCODEC_BLOCK_SIZE 4096 diff --git a/core/fxcodec/codec/fx_codec_tiff.cpp b/core/fxcodec/codec/fx_codec_tiff.cpp index d4e5ddeeb8..f4fa01aabc 100644 --- a/core/fxcodec/codec/fx_codec_tiff.cpp +++ b/core/fxcodec/codec/fx_codec_tiff.cpp @@ -6,7 +6,7 @@ #include "core/fxcodec/codec/codec_int.h" #include "core/fxcodec/fx_codec.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" extern "C" { #include "third_party/libtiff/tiffiop.h" diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp index 72548100ae..4f9c85c8a9 100644 --- a/core/fxge/agg/fx_agg_driver.cpp +++ b/core/fxge/agg/fx_agg_driver.cpp @@ -10,15 +10,15 @@ #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_memory.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "core/fxge/dib/dib_int.h" #include "core/fxge/ge/cfx_cliprgn.h" #include "core/fxge/ge/fx_text_int.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/ifx_renderdevicedriver.h" +#include "core/fxge/ifx_renderdevicedriver.h" #include "third_party/agg23/agg_conv_dash.h" #include "third_party/agg23/agg_conv_stroke.h" #include "third_party/agg23/agg_curves.h" diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h index 6dcd44c31f..0789d022f3 100644 --- a/core/fxge/agg/fx_agg_driver.h +++ b/core/fxge/agg/fx_agg_driver.h @@ -10,7 +10,7 @@ #include #include -#include "core/fxge/include/ifx_renderdevicedriver.h" +#include "core/fxge/ifx_renderdevicedriver.h" #include "third_party/agg23/agg_clip_liang_barsky.h" #include "third_party/agg23/agg_path_storage.h" #include "third_party/agg23/agg_rasterizer_scanline_aa.h" diff --git a/core/fxge/android/fpf_skiafont.cpp b/core/fxge/android/fpf_skiafont.cpp index b154ec422b..58e472247a 100644 --- a/core/fxge/android/fpf_skiafont.cpp +++ b/core/fxge/android/fpf_skiafont.cpp @@ -12,7 +12,7 @@ #include "core/fxge/android/fpf_skiafont.h" #include "core/fxge/android/fpf_skiafontmgr.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_freetype.h" #define FPF_EM_ADJUST(em, a) (em == 0 ? (a) : (a)*1000 / em) diff --git a/core/fxge/android/fpf_skiafont.h b/core/fxge/android/fpf_skiafont.h index eb5bc44a85..1a952628a9 100644 --- a/core/fxge/android/fpf_skiafont.h +++ b/core/fxge/android/fpf_skiafont.h @@ -11,7 +11,7 @@ #if _FX_OS_ == _FX_ANDROID_ -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_font.h" class CFPF_SkiaFontDescriptor; class CFPF_SkiaFontMgr; diff --git a/core/fxge/android/fpf_skiafontmgr.cpp b/core/fxge/android/fpf_skiafontmgr.cpp index 67b58d74ce..9452c11747 100644 --- a/core/fxge/android/fpf_skiafontmgr.cpp +++ b/core/fxge/android/fpf_skiafontmgr.cpp @@ -16,7 +16,7 @@ #include "core/fxcrt/fx_ext.h" #include "core/fxge/android/fpf_skiafont.h" #include "core/fxge/android/fpf_skiafontmgr.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_freetype.h" #ifdef __cplusplus extern "C" { diff --git a/core/fxge/android/fpf_skiafontmgr.h b/core/fxge/android/fpf_skiafontmgr.h index a0c9f5bffe..897e21f981 100644 --- a/core/fxge/android/fpf_skiafontmgr.h +++ b/core/fxge/android/fpf_skiafontmgr.h @@ -14,7 +14,7 @@ #include #include -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_font.h" #define FPF_SKIAFONTTYPE_Unknown 0 #define FPF_SKIAFONTTYPE_Path 1 diff --git a/core/fxge/android/fx_android_font.cpp b/core/fxge/android/fx_android_font.cpp index 1c17432a45..2ffc897332 100644 --- a/core/fxge/android/fx_android_font.cpp +++ b/core/fxge/android/fx_android_font.cpp @@ -11,7 +11,7 @@ #include "core/fxge/android/fpf_skiafont.h" #include "core/fxge/android/fpf_skiafontmgr.h" #include "core/fxge/android/fx_android_font.h" -#include "core/fxge/include/cfx_fontmapper.h" +#include "core/fxge/cfx_fontmapper.h" CFX_AndroidFontInfo::CFX_AndroidFontInfo() : m_pFontMgr(nullptr) {} CFX_AndroidFontInfo::~CFX_AndroidFontInfo() {} diff --git a/core/fxge/android/fx_android_font.h b/core/fxge/android/fx_android_font.h index e9fbb3618c..5b75d9d06e 100644 --- a/core/fxge/android/fx_android_font.h +++ b/core/fxge/android/fx_android_font.h @@ -11,9 +11,9 @@ #if _FX_OS_ == _FX_ANDROID_ -#include "core/fxge/include/cfx_fontmapper.h" -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/ifx_systemfontinfo.h" +#include "core/fxge/cfx_fontmapper.h" +#include "core/fxge/fx_font.h" +#include "core/fxge/ifx_systemfontinfo.h" class CFPF_SkiaFontMgr; diff --git a/core/fxge/android/fx_android_imp.cpp b/core/fxge/android/fx_android_imp.cpp index 79222b02f4..6e9dafc0e4 100644 --- a/core/fxge/android/fx_android_imp.cpp +++ b/core/fxge/android/fx_android_imp.cpp @@ -13,7 +13,7 @@ #include "core/fxge/android/fpf_skiamodule.h" #include "core/fxge/android/fx_android_font.h" -#include "core/fxge/include/cfx_gemodule.h" +#include "core/fxge/cfx_gemodule.h" void CFX_GEModule::InitPlatform() { CFPF_SkiaDeviceModule* pDeviceModule = CFPF_GetSkiaDeviceModule(); diff --git a/core/fxge/apple/apple_int.h b/core/fxge/apple/apple_int.h index c7cb24365e..b85d4a784a 100644 --- a/core/fxge/apple/apple_int.h +++ b/core/fxge/apple/apple_int.h @@ -11,11 +11,11 @@ #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/fx_dib.h" -#include "core/fxge/include/ifx_renderdevicedriver.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" +#include "core/fxge/fx_dib.h" +#include "core/fxge/ifx_renderdevicedriver.h" #if _FX_OS_ == _FX_MACOSX_ #include diff --git a/core/fxge/apple/cfx_quartzdevice.h b/core/fxge/apple/cfx_quartzdevice.h index 826309f3d7..75df61b160 100644 --- a/core/fxge/apple/cfx_quartzdevice.h +++ b/core/fxge/apple/cfx_quartzdevice.h @@ -9,7 +9,7 @@ #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_renderdevice.h" class CFX_QuartzDevice : public CFX_RenderDevice { public: diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp index 8a0c1e0538..2108d4d2e4 100644 --- a/core/fxge/apple/fx_apple_platform.cpp +++ b/core/fxge/apple/fx_apple_platform.cpp @@ -14,13 +14,13 @@ #include "core/fxge/apple/apple_int.h" #include "core/fxge/apple/cfx_quartzdevice.h" +#include "core/fxge/cfx_facecache.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_renderdevice.h" #include "core/fxge/dib/dib_int.h" +#include "core/fxge/fx_freetype.h" #include "core/fxge/ge/cfx_cliprgn.h" #include "core/fxge/ge/fx_text_int.h" -#include "core/fxge/include/cfx_facecache.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/fx_freetype.h" #ifndef _SKIA_SUPPORT_ diff --git a/core/fxge/apple/fx_mac_imp.cpp b/core/fxge/apple/fx_mac_imp.cpp index addcb6d815..3df88301b1 100644 --- a/core/fxge/apple/fx_mac_imp.cpp +++ b/core/fxge/apple/fx_mac_imp.cpp @@ -5,9 +5,9 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "core/fxge/apple/apple_int.h" +#include "core/fxge/cfx_gemodule.h" #include "core/fxge/ge/cfx_folderfontinfo.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/ifx_systemfontinfo.h" +#include "core/fxge/ifx_systemfontinfo.h" #if _FX_OS_ == _FX_MACOSX_ diff --git a/core/fxge/apple/fx_quartz_device.cpp b/core/fxge/apple/fx_quartz_device.cpp index 9089710778..d3520d7257 100644 --- a/core/fxge/apple/fx_quartz_device.cpp +++ b/core/fxge/apple/fx_quartz_device.cpp @@ -11,13 +11,13 @@ #endif #include "core/fxcrt/fx_memory.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "core/fxge/dib/dib_int.h" +#include "core/fxge/fx_freetype.h" #include "core/fxge/ge/fx_text_int.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/fx_freetype.h" #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ #include "core/fxge/apple/apple_int.h" diff --git a/core/fxge/cfx_facecache.h b/core/fxge/cfx_facecache.h new file mode 100644 index 0000000000..98ffe7a928 --- /dev/null +++ b/core/fxge/cfx_facecache.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_FXGE_CFX_FACECACHE_H_ +#define CORE_FXGE_CFX_FACECACHE_H_ + +#include + +#include "core/fxge/fx_font.h" +#include "core/fxge/fx_freetype.h" + +class CFX_FaceCache { + public: + explicit CFX_FaceCache(FXFT_Face face); + ~CFX_FaceCache(); + const CFX_GlyphBitmap* LoadGlyphBitmap(const CFX_Font* pFont, + uint32_t glyph_index, + FX_BOOL bFontStyle, + const CFX_Matrix* pMatrix, + int dest_width, + int anti_alias, + int& text_flags); + const CFX_PathData* LoadGlyphPath(const CFX_Font* pFont, + uint32_t glyph_index, + int dest_width); + +#ifdef _SKIA_SUPPORT_ + CFX_TypeFace* GetDeviceCache(const CFX_Font* pFont); +#endif + + private: + CFX_GlyphBitmap* RenderGlyph(const CFX_Font* pFont, + uint32_t glyph_index, + FX_BOOL bFontStyle, + const CFX_Matrix* pMatrix, + int dest_width, + int anti_alias); + CFX_GlyphBitmap* RenderGlyph_Nativetext(const CFX_Font* pFont, + uint32_t glyph_index, + const CFX_Matrix* pMatrix, + int dest_width, + int anti_alias); + CFX_GlyphBitmap* LookUpGlyphBitmap(const CFX_Font* pFont, + const CFX_Matrix* pMatrix, + const CFX_ByteString& FaceGlyphsKey, + uint32_t glyph_index, + FX_BOOL bFontStyle, + int dest_width, + int anti_alias); + void InitPlatform(); + void DestroyPlatform(); + + FXFT_Face const m_Face; + std::map> m_SizeMap; + std::map> m_PathMap; +#ifdef _SKIA_SUPPORT_ + CFX_TypeFace* m_pTypeface; +#endif +}; + +#endif // CORE_FXGE_CFX_FACECACHE_H_ diff --git a/core/fxge/cfx_fontcache.h b/core/fxge/cfx_fontcache.h new file mode 100644 index 0000000000..52ac3fa342 --- /dev/null +++ b/core/fxge/cfx_fontcache.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_FXGE_CFX_FONTCACHE_H_ +#define CORE_FXGE_CFX_FONTCACHE_H_ + +#include +#include + +#include "core/fxcrt/fx_system.h" +#include "core/fxge/fx_font.h" +#include "core/fxge/fx_freetype.h" + +class CFX_FaceCache; + +class CFX_FontCache { + public: + CFX_FontCache(); + ~CFX_FontCache(); + CFX_FaceCache* GetCachedFace(const CFX_Font* pFont); + void ReleaseCachedFace(const CFX_Font* pFont); +#ifdef _SKIA_SUPPORT_ + CFX_TypeFace* GetDeviceCache(const CFX_Font* pFont); +#endif + + private: + struct CountedFaceCache { + CountedFaceCache(); + ~CountedFaceCache(); + std::unique_ptr m_Obj; + uint32_t m_nCount; + }; + + using CFX_FTCacheMap = std::map>; + CFX_FTCacheMap m_FTFaceMap; + CFX_FTCacheMap m_ExtFaceMap; +}; + +#endif // CORE_FXGE_CFX_FONTCACHE_H_ diff --git a/core/fxge/cfx_fontmapper.h b/core/fxge/cfx_fontmapper.h new file mode 100644 index 0000000000..383550b33a --- /dev/null +++ b/core/fxge/cfx_fontmapper.h @@ -0,0 +1,84 @@ +// 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_FXGE_CFX_FONTMAPPER_H_ +#define CORE_FXGE_CFX_FONTMAPPER_H_ + +#include +#include + +#include "core/fxge/cfx_fontmgr.h" +#include "core/fxge/fx_font.h" + +class CFX_SubstFont; + +class CFX_FontMapper { + public: + explicit CFX_FontMapper(CFX_FontMgr* mgr); + ~CFX_FontMapper(); + + void SetSystemFontInfo(std::unique_ptr pFontInfo); + IFX_SystemFontInfo* GetSystemFontInfo() { return m_pFontInfo.get(); } + void AddInstalledFont(const CFX_ByteString& name, int charset); + void LoadInstalledFonts(); + + FXFT_Face FindSubstFont(const CFX_ByteString& face_name, + FX_BOOL bTrueType, + uint32_t flags, + int weight, + int italic_angle, + int CharsetCP, + CFX_SubstFont* pSubstFont); +#ifdef PDF_ENABLE_XFA + FXFT_Face FindSubstFontByUnicode(uint32_t dwUnicode, + uint32_t flags, + int weight, + int italic_angle); +#endif // PDF_ENABLE_XFA + FX_BOOL IsBuiltinFace(const FXFT_Face face) const; + int GetFaceSize() const; + CFX_ByteString GetFaceName(int index) const { + return m_FaceArray[index].name; + } + + std::vector m_InstalledTTFonts; + + private: + static const size_t MM_FACE_COUNT = 2; + static const size_t FOXIT_FACE_COUNT = 14; + + CFX_ByteString GetPSNameFromTT(void* hFont); + CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name); + FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont, + int iBaseFont, + int italic_angle, + int weight, + int picthfamily); + FXFT_Face GetCachedTTCFace(void* hFont, + const uint32_t tableTTCF, + uint32_t ttc_size, + uint32_t font_size); + FXFT_Face GetCachedFace(void* hFont, + CFX_ByteString SubstName, + int weight, + FX_BOOL bItalic, + uint32_t font_size); + + struct FaceData { + CFX_ByteString name; + uint32_t charset; + }; + + FX_BOOL m_bListLoaded; + FXFT_Face m_MMFaces[MM_FACE_COUNT]; + CFX_ByteString m_LastFamily; + std::vector m_FaceArray; + std::unique_ptr m_pFontInfo; + FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT]; + CFX_FontMgr* const m_pFontMgr; +}; + +#endif // CORE_FXGE_CFX_FONTMAPPER_H_ diff --git a/core/fxge/cfx_fontmgr.h b/core/fxge/cfx_fontmgr.h new file mode 100644 index 0000000000..67357e4265 --- /dev/null +++ b/core/fxge/cfx_fontmgr.h @@ -0,0 +1,69 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FXGE_CFX_FONTMGR_H_ +#define CORE_FXGE_CFX_FONTMGR_H_ + +#include +#include + +#include "core/fxge/fx_font.h" + +class IFX_SystemFontInfo; +class CFX_FontMapper; +class CFX_SubstFont; +class CTTFontDesc; + +class CFX_FontMgr { + public: + CFX_FontMgr(); + ~CFX_FontMgr(); + + void InitFTLibrary(); + + FXFT_Face GetCachedFace(const CFX_ByteString& face_name, + int weight, + FX_BOOL bItalic, + uint8_t*& pFontData); + FXFT_Face AddCachedFace(const CFX_ByteString& face_name, + int weight, + FX_BOOL bItalic, + uint8_t* pData, + uint32_t size, + int face_index); + FXFT_Face GetCachedTTCFace(int ttc_size, + uint32_t checksum, + int font_offset, + uint8_t*& pFontData); + FXFT_Face AddCachedTTCFace(int ttc_size, + uint32_t checksum, + uint8_t* pData, + uint32_t size, + int font_offset); + FXFT_Face GetFileFace(const FX_CHAR* filename, int face_index); + FXFT_Face GetFixedFace(const uint8_t* pData, uint32_t size, int face_index); + void ReleaseFace(FXFT_Face face); + void SetSystemFontInfo(std::unique_ptr pFontInfo); + FXFT_Face FindSubstFont(const CFX_ByteString& face_name, + FX_BOOL bTrueType, + uint32_t flags, + int weight, + int italic_angle, + int CharsetCP, + CFX_SubstFont* pSubstFont); + bool GetBuiltinFont(size_t index, const uint8_t** pFontData, uint32_t* size); + CFX_FontMapper* GetBuiltinMapper() const { return m_pBuiltinMapper.get(); } + FXFT_Library GetFTLibrary() const { return m_FTLibrary; } + bool FTLibrarySupportsHinting() const { return m_FTLibrarySupportsHinting; } + + private: + std::unique_ptr m_pBuiltinMapper; + std::map m_FaceMap; + FXFT_Library m_FTLibrary; + bool m_FTLibrarySupportsHinting; +}; + +#endif // CORE_FXGE_CFX_FONTMGR_H_ diff --git a/core/fxge/cfx_fxgedevice.h b/core/fxge/cfx_fxgedevice.h new file mode 100644 index 0000000000..8358e43666 --- /dev/null +++ b/core/fxge/cfx_fxgedevice.h @@ -0,0 +1,46 @@ +// 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_FXGE_CFX_FXGEDEVICE_H_ +#define CORE_FXGE_CFX_FXGEDEVICE_H_ + +#include "core/fxge/cfx_renderdevice.h" +#include "core/fxge/fx_dib.h" + +class SkPictureRecorder; + +class CFX_FxgeDevice : public CFX_RenderDevice { + public: + CFX_FxgeDevice(); + ~CFX_FxgeDevice() override; + + bool Attach(CFX_DIBitmap* pBitmap, + bool bRgbByteOrder, + CFX_DIBitmap* pOriDevice, + bool bGroupKnockout); + bool Create(int width, + int height, + FXDIB_Format format, + CFX_DIBitmap* pOriDevice); + +#ifdef _SKIA_SUPPORT_ + bool AttachRecorder(SkPictureRecorder* recorder); + void Clear(uint32_t color); + SkPictureRecorder* CreateRecorder(int size_x, int size_y); + void DebugVerifyBitmapIsPreMultiplied() const override; + bool SetBitsWithMask(const CFX_DIBSource* pBitmap, + const CFX_DIBSource* pMask, + int left, + int top, + int bitmap_alpha, + int blend_type) override; +#endif + + private: + bool m_bOwnedBitmap; +}; + +#endif // CORE_FXGE_CFX_FXGEDEVICE_H_ diff --git a/core/fxge/cfx_gemodule.h b/core/fxge/cfx_gemodule.h new file mode 100644 index 0000000000..c5bd841002 --- /dev/null +++ b/core/fxge/cfx_gemodule.h @@ -0,0 +1,50 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FXGE_CFX_GEMODULE_H_ +#define CORE_FXGE_CFX_GEMODULE_H_ + +#include + +#include "core/fxge/cfx_fontmgr.h" +#include "core/fxge/fx_font.h" + +class CCodec_ModuleMgr; +class CFX_FontCache; +class CFX_FontMgr; + +class CFX_GEModule { + public: + static CFX_GEModule* Get(); + static void Destroy(); + + void Init(const char** pUserFontPaths, CCodec_ModuleMgr* pCodecModule); + CFX_FontCache* GetFontCache(); + CFX_FontMgr* GetFontMgr() { return m_pFontMgr.get(); } + void SetTextGamma(FX_FLOAT gammaValue); + const uint8_t* GetTextGammaTable() const; + + CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; } + void* GetPlatformData() { return m_pPlatformData; } + + FXFT_Library m_FTLibrary; + + private: + CFX_GEModule(); + ~CFX_GEModule(); + + void InitPlatform(); + void DestroyPlatform(); + + uint8_t m_GammaValue[256]; + CFX_FontCache* m_pFontCache; + std::unique_ptr m_pFontMgr; + CCodec_ModuleMgr* m_pCodecModule; + void* m_pPlatformData; + const char** m_pUserFontPaths; +}; + +#endif // CORE_FXGE_CFX_GEMODULE_H_ diff --git a/core/fxge/cfx_graphstate.h b/core/fxge/cfx_graphstate.h new file mode 100644 index 0000000000..19cd03c8e1 --- /dev/null +++ b/core/fxge/cfx_graphstate.h @@ -0,0 +1,44 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FXGE_CFX_GRAPHSTATE_H_ +#define CORE_FXGE_CFX_GRAPHSTATE_H_ + +#include "core/fxcrt/cfx_count_ref.h" +#include "core/fxge/cfx_graphstatedata.h" + +class CPDF_Array; + +class CFX_GraphState { + public: + CFX_GraphState(); + CFX_GraphState(const CFX_GraphState& that); + ~CFX_GraphState(); + + void Emplace(); + + void SetLineDash(CPDF_Array* pArray, FX_FLOAT phase, FX_FLOAT scale); + + FX_FLOAT GetLineWidth() const; + void SetLineWidth(FX_FLOAT width); + + CFX_GraphStateData::LineCap GetLineCap() const; + void SetLineCap(CFX_GraphStateData::LineCap cap); + + CFX_GraphStateData::LineJoin GetLineJoin() const; + void SetLineJoin(CFX_GraphStateData::LineJoin join); + + FX_FLOAT GetMiterLimit() const; + void SetMiterLimit(FX_FLOAT limit); + + // FIXME(tsepez): remove when all GraphStateData usage gone. + const CFX_GraphStateData* GetObject() const { return m_Ref.GetObject(); } + + private: + CFX_CountRef m_Ref; +}; + +#endif // CORE_FXGE_CFX_GRAPHSTATE_H_ diff --git a/core/fxge/cfx_graphstatedata.h b/core/fxge/cfx_graphstatedata.h new file mode 100644 index 0000000000..03e4a8f51a --- /dev/null +++ b/core/fxge/cfx_graphstatedata.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_FXGE_CFX_GRAPHSTATEDATA_H_ +#define CORE_FXGE_CFX_GRAPHSTATEDATA_H_ + +#include "core/fxcrt/fx_system.h" + +class CFX_GraphStateData { + public: + enum LineCap { LineCapButt = 0, LineCapRound = 1, LineCapSquare = 2 }; + + CFX_GraphStateData(); + CFX_GraphStateData(const CFX_GraphStateData& src); + ~CFX_GraphStateData(); + + void Copy(const CFX_GraphStateData& src); + void SetDashCount(int count); + + LineCap m_LineCap; + int m_DashCount; + FX_FLOAT* m_DashArray; + FX_FLOAT m_DashPhase; + + enum LineJoin { + LineJoinMiter = 0, + LineJoinRound = 1, + LineJoinBevel = 2, + }; + LineJoin m_LineJoin; + FX_FLOAT m_MiterLimit; + FX_FLOAT m_LineWidth; +}; + +#endif // CORE_FXGE_CFX_GRAPHSTATEDATA_H_ diff --git a/core/fxge/cfx_pathdata.h b/core/fxge/cfx_pathdata.h new file mode 100644 index 0000000000..e24feb5888 --- /dev/null +++ b/core/fxge/cfx_pathdata.h @@ -0,0 +1,56 @@ +// 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_FXGE_CFX_PATHDATA_H_ +#define CORE_FXGE_CFX_PATHDATA_H_ + +#include "core/fxcrt/fx_coordinates.h" +#include "core/fxcrt/fx_system.h" +#include "core/fxge/cfx_renderdevice.h" + +struct FX_PATHPOINT { + FX_FLOAT m_PointX; + FX_FLOAT m_PointY; + int m_Flag; +}; + +class CFX_PathData { + public: + CFX_PathData(); + CFX_PathData(const CFX_PathData& src); + ~CFX_PathData(); + + int GetPointCount() const { return m_PointCount; } + int GetFlag(int index) const { return m_pPoints[index].m_Flag; } + FX_FLOAT GetPointX(int index) const { return m_pPoints[index].m_PointX; } + FX_FLOAT GetPointY(int index) const { return m_pPoints[index].m_PointY; } + FX_PATHPOINT* GetPoints() const { return m_pPoints; } + + void SetPointCount(int nPoints); + void AllocPointCount(int nPoints); + void AddPointCount(int addPoints); + CFX_FloatRect GetBoundingBox() const; + CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const; + void Transform(const CFX_Matrix* pMatrix); + FX_BOOL IsRect() const; + FX_BOOL GetZeroAreaPath(CFX_PathData& NewPath, + CFX_Matrix* pMatrix, + FX_BOOL& bThin, + FX_BOOL bAdjust) const; + FX_BOOL IsRect(const CFX_Matrix* pMatrix, CFX_FloatRect* rect) const; + void Append(const CFX_PathData* pSrc, const CFX_Matrix* pMatrix); + void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top); + void SetPoint(int index, FX_FLOAT x, FX_FLOAT y, int flag); + void TrimPoints(int nPoints); + void Copy(const CFX_PathData& src); + + private: + int m_PointCount; + int m_AllocCount; + FX_PATHPOINT* m_pPoints; +}; + +#endif // CORE_FXGE_CFX_PATHDATA_H_ diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h new file mode 100644 index 0000000000..4d7db1235e --- /dev/null +++ b/core/fxge/cfx_renderdevice.h @@ -0,0 +1,258 @@ +// 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_FXGE_CFX_RENDERDEVICE_H_ +#define CORE_FXGE_CFX_RENDERDEVICE_H_ + +#include + +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/fx_dib.h" +#include "core/fxge/fx_font.h" + +class CFX_Font; +class CFX_GraphStateData; +class IFX_RenderDeviceDriver; + +#define FXDC_DEVICE_CLASS 1 +#define FXDC_PIXEL_WIDTH 2 +#define FXDC_PIXEL_HEIGHT 3 +#define FXDC_BITS_PIXEL 4 +#define FXDC_HORZ_SIZE 5 +#define FXDC_VERT_SIZE 6 +#define FXDC_RENDER_CAPS 7 +#define FXDC_DISPLAY 1 +#define FXDC_PRINTER 2 + +#define FXPT_CLOSEFIGURE 0x01 +#define FXPT_LINETO 0x02 +#define FXPT_BEZIERTO 0x04 +#define FXPT_MOVETO 0x06 +#define FXPT_TYPE 0x06 + +#define FXRC_GET_BITS 0x01 +#define FXRC_BIT_MASK 0x02 +#define FXRC_ALPHA_MASK 0x04 +#define FXRC_ALPHA_PATH 0x10 +#define FXRC_ALPHA_IMAGE 0x20 +#define FXRC_ALPHA_OUTPUT 0x40 +#define FXRC_BLEND_MODE 0x80 +#define FXRC_SOFT_CLIP 0x100 +#define FXRC_CMYK_OUTPUT 0x200 +#define FXRC_BITMASK_OUTPUT 0x400 +#define FXRC_BYTEMASK_OUTPUT 0x800 +#define FXRENDER_IMAGE_LOSSY 0x1000 +#define FXRC_FILLSTROKE_PATH 0x2000 +#define FXRC_SHADING 0x4000 + +#define FXFILL_ALTERNATE 1 +#define FXFILL_WINDING 2 +#define FXFILL_FULLCOVER 4 +#define FXFILL_RECT_AA 8 +#define FX_FILL_STROKE 16 +#define FX_STROKE_ADJUST 32 +#define FX_STROKE_TEXT_MODE 64 +#define FX_FILL_TEXT_MODE 128 +#define FX_ZEROAREA_FILL 256 +#define FXFILL_NOPATHSMOOTH 512 + +#define FXTEXT_CLEARTYPE 0x01 +#define FXTEXT_BGR_STRIPE 0x02 +#define FXTEXT_PRINTGRAPHICTEXT 0x04 +#define FXTEXT_NO_NATIVETEXT 0x08 +#define FXTEXT_PRINTIMAGETEXT 0x10 +#define FXTEXT_NOSMOOTH 0x20 + +struct FXTEXT_CHARPOS { + FX_FLOAT m_AdjustMatrix[4]; + FX_FLOAT m_OriginX; + FX_FLOAT m_OriginY; + uint32_t m_GlyphIndex; + int32_t m_FontCharWidth; +#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ + uint32_t m_ExtGID; +#endif + int32_t m_FallbackFontPosition; + bool m_bGlyphAdjust; + bool m_bFontStyle; +}; + +class CFX_RenderDevice { + public: + CFX_RenderDevice(); + virtual ~CFX_RenderDevice(); + + // Take ownership of |pDriver|. + void SetDeviceDriver(std::unique_ptr pDriver); + IFX_RenderDeviceDriver* GetDeviceDriver() const { + return m_pDeviceDriver.get(); + } + + void SaveState(); + void RestoreState(bool bKeepSaved); + + int GetWidth() const { return m_Width; } + int GetHeight() const { return m_Height; } + int GetDeviceClass() const { return m_DeviceClass; } + int GetRenderCaps() const { return m_RenderCaps; } + int GetDeviceCaps(int id) const; + CFX_Matrix GetCTM() const; + CFX_DIBitmap* GetBitmap() const { return m_pBitmap; } + void SetBitmap(CFX_DIBitmap* pBitmap) { m_pBitmap = pBitmap; } + FX_BOOL CreateCompatibleBitmap(CFX_DIBitmap* pDIB, + int width, + int height) const; + const FX_RECT& GetClipBox() const { return m_ClipBox; } + FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, + const CFX_Matrix* pObject2Device, + int fill_mode); + FX_BOOL SetClip_Rect(const FX_RECT& pRect); + FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, + const CFX_Matrix* pObject2Device, + const CFX_GraphStateData* pGraphState); + FX_BOOL DrawPath(const CFX_PathData* pPathData, + const CFX_Matrix* pObject2Device, + const CFX_GraphStateData* pGraphState, + uint32_t fill_color, + uint32_t stroke_color, + int fill_mode) { + return DrawPathWithBlend(pPathData, pObject2Device, pGraphState, fill_color, + stroke_color, fill_mode, FXDIB_BLEND_NORMAL); + } + FX_BOOL DrawPathWithBlend(const CFX_PathData* pPathData, + const CFX_Matrix* pObject2Device, + const CFX_GraphStateData* pGraphState, + uint32_t fill_color, + uint32_t stroke_color, + int fill_mode, + int blend_type); + FX_BOOL SetPixel(int x, int y, uint32_t color); + FX_BOOL FillRect(const FX_RECT* pRect, uint32_t color) { + return FillRectWithBlend(pRect, color, FXDIB_BLEND_NORMAL); + } + FX_BOOL FillRectWithBlend(const FX_RECT* pRect, + uint32_t color, + int blend_type); + FX_BOOL DrawCosmeticLine(FX_FLOAT x1, + FX_FLOAT y1, + FX_FLOAT x2, + FX_FLOAT y2, + uint32_t color, + int fill_mode, + int blend_type); + + FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top); + CFX_DIBitmap* GetBackDrop(); + FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, int left, int top) { + return SetDIBitsWithBlend(pBitmap, left, top, FXDIB_BLEND_NORMAL); + } + FX_BOOL SetDIBitsWithBlend(const CFX_DIBSource* pBitmap, + int left, + int top, + int blend_type); + FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, + int left, + int top, + int dest_width, + int dest_height) { + return StretchDIBitsWithFlagsAndBlend(pBitmap, left, top, dest_width, + dest_height, 0, FXDIB_BLEND_NORMAL); + } + FX_BOOL StretchDIBitsWithFlagsAndBlend(const CFX_DIBSource* pBitmap, + int left, + int top, + int dest_width, + int dest_height, + uint32_t flags, + int blend_type); + FX_BOOL SetBitMask(const CFX_DIBSource* pBitmap, + int left, + int top, + uint32_t color); + FX_BOOL StretchBitMask(const CFX_DIBSource* pBitmap, + int left, + int top, + int dest_width, + int dest_height, + uint32_t color); + FX_BOOL StretchBitMaskWithFlags(const CFX_DIBSource* pBitmap, + int left, + int top, + int dest_width, + int dest_height, + uint32_t color, + uint32_t flags); + FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, + int bitmap_alpha, + uint32_t color, + const CFX_Matrix* pMatrix, + uint32_t flags, + void*& handle) { + return StartDIBitsWithBlend(pBitmap, bitmap_alpha, color, pMatrix, flags, + handle, FXDIB_BLEND_NORMAL); + } + FX_BOOL StartDIBitsWithBlend(const CFX_DIBSource* pBitmap, + int bitmap_alpha, + uint32_t color, + const CFX_Matrix* pMatrix, + uint32_t flags, + void*& handle, + int blend_type); + FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); + void CancelDIBits(void* handle); + + FX_BOOL DrawNormalText(int nChars, + const FXTEXT_CHARPOS* pCharPos, + CFX_Font* pFont, + FX_FLOAT font_size, + const CFX_Matrix* pText2Device, + uint32_t fill_color, + uint32_t text_flags); + FX_BOOL DrawTextPath(int nChars, + const FXTEXT_CHARPOS* pCharPos, + CFX_Font* pFont, + FX_FLOAT font_size, + const CFX_Matrix* pText2User, + const CFX_Matrix* pUser2Device, + const CFX_GraphStateData* pGraphState, + uint32_t fill_color, + uint32_t stroke_color, + CFX_PathData* pClippingPath, + int nFlag); + +#ifdef _SKIA_SUPPORT_ + virtual void DebugVerifyBitmapIsPreMultiplied() const; + virtual bool SetBitsWithMask(const CFX_DIBSource* pBitmap, + const CFX_DIBSource* pMask, + int left, + int top, + int bitmap_alpha, + int blend_type); + void Flush(); +#endif + + private: + void InitDeviceInfo(); + void UpdateClipBox(); + FX_BOOL DrawFillStrokePath(const CFX_PathData* pPathData, + const CFX_Matrix* pObject2Device, + const CFX_GraphStateData* pGraphState, + uint32_t fill_color, + uint32_t stroke_color, + int fill_mode, + int blend_type); + + CFX_DIBitmap* m_pBitmap; + int m_Width; + int m_Height; + int m_bpp; + int m_RenderCaps; + int m_DeviceClass; + FX_RECT m_ClipBox; + std::unique_ptr m_pDeviceDriver; +}; + +#endif // CORE_FXGE_CFX_RENDERDEVICE_H_ diff --git a/core/fxge/cfx_substfont.h b/core/fxge/cfx_substfont.h new file mode 100644 index 0000000000..943f7bf866 --- /dev/null +++ b/core/fxge/cfx_substfont.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_FXGE_CFX_SUBSTFONT_H_ +#define CORE_FXGE_CFX_SUBSTFONT_H_ + +#include "core/fxcrt/fx_string.h" + +#define FXFONT_SUBST_MM 0x01 +#define FXFONT_SUBST_GLYPHPATH 0x04 +#define FXFONT_SUBST_CLEARTYPE 0x08 +#define FXFONT_SUBST_TRANSFORM 0x10 +#define FXFONT_SUBST_NONSYMBOL 0x20 +#define FXFONT_SUBST_EXACT 0x40 +#define FXFONT_SUBST_STANDARD 0x80 + +class CFX_SubstFont { + public: + CFX_SubstFont(); + + CFX_ByteString m_Family; + int m_Charset; + uint32_t m_SubstFlags; + int m_Weight; + int m_ItalicAngle; + bool m_bSubstCJK; + int m_WeightCJK; + bool m_bItalicCJK; +}; + +#endif // CORE_FXGE_CFX_SUBSTFONT_H_ diff --git a/core/fxge/cfx_unicodeencoding.h b/core/fxge/cfx_unicodeencoding.h new file mode 100644 index 0000000000..7d020894c0 --- /dev/null +++ b/core/fxge/cfx_unicodeencoding.h @@ -0,0 +1,46 @@ +// 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_FXGE_CFX_UNICODEENCODING_H_ +#define CORE_FXGE_CFX_UNICODEENCODING_H_ + +#include "core/fxge/fx_font.h" + +#define ENCODING_INTERNAL 0 +#define ENCODING_UNICODE 1 + +#ifdef PDF_ENABLE_XFA +#define FXFM_ENC_TAG(a, b, c, d) \ + (((uint32_t)(a) << 24) | ((uint32_t)(b) << 16) | ((uint32_t)(c) << 8) | \ + (uint32_t)(d)) +#define FXFM_ENCODING_NONE FXFM_ENC_TAG(0, 0, 0, 0) +#define FXFM_ENCODING_MS_SYMBOL FXFM_ENC_TAG('s', 'y', 'm', 'b') +#define FXFM_ENCODING_UNICODE FXFM_ENC_TAG('u', 'n', 'i', 'c') +#define FXFM_ENCODING_MS_SJIS FXFM_ENC_TAG('s', 'j', 'i', 's') +#define FXFM_ENCODING_MS_GB2312 FXFM_ENC_TAG('g', 'b', ' ', ' ') +#define FXFM_ENCODING_MS_BIG5 FXFM_ENC_TAG('b', 'i', 'g', '5') +#define FXFM_ENCODING_MS_WANSUNG FXFM_ENC_TAG('w', 'a', 'n', 's') +#define FXFM_ENCODING_MS_JOHAB FXFM_ENC_TAG('j', 'o', 'h', 'a') +#define FXFM_ENCODING_ADOBE_STANDARD FXFM_ENC_TAG('A', 'D', 'O', 'B') +#define FXFM_ENCODING_ADOBE_EXPERT FXFM_ENC_TAG('A', 'D', 'B', 'E') +#define FXFM_ENCODING_ADOBE_CUSTOM FXFM_ENC_TAG('A', 'D', 'B', 'C') +#define FXFM_ENCODING_ADOBE_LATIN_1 FXFM_ENC_TAG('l', 'a', 't', '1') +#define FXFM_ENCODING_OLD_LATIN_2 FXFM_ENC_TAG('l', 'a', 't', '2') +#define FXFM_ENCODING_APPLE_ROMAN FXFM_ENC_TAG('a', 'r', 'm', 'n') +#endif // PDF_ENABLE_XFA + +class CFX_UnicodeEncoding { + public: + explicit CFX_UnicodeEncoding(CFX_Font* pFont); + virtual ~CFX_UnicodeEncoding(); + + virtual uint32_t GlyphFromCharCode(uint32_t charcode); + + protected: + CFX_Font* m_pFont; // Unowned, not nullptr. +}; + +#endif // CORE_FXGE_CFX_UNICODEENCODING_H_ diff --git a/core/fxge/cfx_unicodeencodingex.h b/core/fxge/cfx_unicodeencodingex.h new file mode 100644 index 0000000000..df2edbe1bf --- /dev/null +++ b/core/fxge/cfx_unicodeencodingex.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_FXGE_CFX_UNICODEENCODINGEX_H_ +#define CORE_FXGE_CFX_UNICODEENCODINGEX_H_ + +#include +#include +#include + +#include "core/fxcrt/fx_system.h" +#include "core/fxge/cfx_unicodeencoding.h" +#include "core/fxge/fx_dib.h" +#include "core/fxge/fx_freetype.h" + +class CFX_UnicodeEncodingEx : public CFX_UnicodeEncoding { + public: + CFX_UnicodeEncodingEx(CFX_Font* pFont, uint32_t EncodingID); + ~CFX_UnicodeEncodingEx() override; + + // CFX_UnicodeEncoding: + uint32_t GlyphFromCharCode(uint32_t charcode) override; + + uint32_t CharCodeFromUnicode(FX_WCHAR Unicode) const; + + private: + uint32_t m_nEncodingID; +}; + +CFX_UnicodeEncodingEx* FX_CreateFontEncodingEx( + CFX_Font* pFont, + uint32_t nEncodingID = FXFM_ENCODING_NONE); + +#endif // CORE_FXGE_CFX_UNICODEENCODINGEX_H_ diff --git a/core/fxge/cfx_windowsdevice.h b/core/fxge/cfx_windowsdevice.h new file mode 100644 index 0000000000..ec065edd63 --- /dev/null +++ b/core/fxge/cfx_windowsdevice.h @@ -0,0 +1,39 @@ +// 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_FXGE_CFX_WINDOWSDEVICE_H_ +#define CORE_FXGE_CFX_WINDOWSDEVICE_H_ + +#ifdef _WIN32 +#ifndef _WINDOWS_ +#include +#endif + +class IFX_RenderDeviceDriver; + +#if defined(PDFIUM_PRINT_TEXT_WITH_GDI) +typedef void (*PDFiumEnsureTypefaceCharactersAccessible)(const LOGFONT* font, + const wchar_t* text, + size_t text_length); + +extern bool g_pdfium_print_text_with_gdi; +extern PDFiumEnsureTypefaceCharactersAccessible + g_pdfium_typeface_accessible_func; +#endif + +class CFX_WindowsDevice : public CFX_RenderDevice { + public: + static IFX_RenderDeviceDriver* CreateDriver(HDC hDC); + + explicit CFX_WindowsDevice(HDC hDC); + ~CFX_WindowsDevice() override; + + HDC GetDC() const; +}; + +#endif // _WIN32 + +#endif // CORE_FXGE_CFX_WINDOWSDEVICE_H_ diff --git a/core/fxge/dib/dib_int.h b/core/fxge/dib/dib_int.h index 0a679e2f5f..aa79b73154 100644 --- a/core/fxge/dib/dib_int.h +++ b/core/fxge/dib/dib_int.h @@ -10,7 +10,7 @@ #include #include "core/fxcrt/fx_coordinates.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" class IFX_ScanlineComposer; diff --git a/core/fxge/dib/fx_dib_composite.cpp b/core/fxge/dib/fx_dib_composite.cpp index fa4cc783df..d180b7a831 100644 --- a/core/fxge/dib/fx_dib_composite.cpp +++ b/core/fxge/dib/fx_dib_composite.cpp @@ -5,9 +5,9 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "core/fxcodec/fx_codec.h" +#include "core/fxge/cfx_gemodule.h" #include "core/fxge/dib/dib_int.h" #include "core/fxge/ge/cfx_cliprgn.h" -#include "core/fxge/include/cfx_gemodule.h" namespace { diff --git a/core/fxge/dib/fx_dib_convert.cpp b/core/fxge/dib/fx_dib_convert.cpp index 829c2113f1..e3ee626fff 100644 --- a/core/fxge/dib/fx_dib_convert.cpp +++ b/core/fxge/dib/fx_dib_convert.cpp @@ -5,7 +5,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "core/fxcodec/fx_codec.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" class CFX_Palette { public: diff --git a/core/fxge/dib/fx_dib_engine.cpp b/core/fxge/dib/fx_dib_engine.cpp index e8401d7663..c8e9558888 100644 --- a/core/fxge/dib/fx_dib_engine.cpp +++ b/core/fxge/dib/fx_dib_engine.cpp @@ -9,7 +9,7 @@ #include #include "core/fxge/dib/dib_int.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" namespace { diff --git a/core/fxge/dib/fx_dib_engine_unittest.cpp b/core/fxge/dib/fx_dib_engine_unittest.cpp index eed6b52194..105c342a0f 100644 --- a/core/fxge/dib/fx_dib_engine_unittest.cpp +++ b/core/fxge/dib/fx_dib_engine_unittest.cpp @@ -10,7 +10,7 @@ #include "core/fpdfapi/fpdf_render/render_int.h" #include "core/fxcrt/fx_memory.h" #include "core/fxge/dib/dib_int.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "testing/gtest/include/gtest/gtest.h" TEST(CStretchEngine, OverflowInCtor) { diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp index 5b40b850b9..14cd0f4da6 100644 --- a/core/fxge/dib/fx_dib_main.cpp +++ b/core/fxge/dib/fx_dib_main.cpp @@ -4,15 +4,15 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include #include #include "core/fxcodec/fx_codec.h" +#include "core/fxge/cfx_gemodule.h" #include "core/fxge/dib/dib_int.h" #include "core/fxge/ge/cfx_cliprgn.h" -#include "core/fxge/include/cfx_gemodule.h" void CmykDecode(uint32_t cmyk, int& c, int& m, int& y, int& k) { c = FXSYS_GetCValue(cmyk); diff --git a/core/fxge/dib/fx_dib_transform.cpp b/core/fxge/dib/fx_dib_transform.cpp index 27dbb82fab..a559fee55d 100644 --- a/core/fxge/dib/fx_dib_transform.cpp +++ b/core/fxge/dib/fx_dib_transform.cpp @@ -6,7 +6,7 @@ #include "core/fxge/dib/dib_int.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" namespace { diff --git a/core/fxge/freetype/fx_freetype.cpp b/core/fxge/freetype/fx_freetype.cpp index 295513d8b3..6aa59fee68 100644 --- a/core/fxge/freetype/fx_freetype.cpp +++ b/core/fxge/freetype/fx_freetype.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_freetype.h" #include "third_party/freetype/src/psnames/pstables.h" diff --git a/core/fxge/fx_dib.h b/core/fxge/fx_dib.h new file mode 100644 index 0000000000..038d103989 --- /dev/null +++ b/core/fxge/fx_dib.h @@ -0,0 +1,680 @@ +// 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_FXGE_FX_DIB_H_ +#define CORE_FXGE_FX_DIB_H_ + +#include +#include + +#include "core/fxcrt/cfx_count_ref.h" +#include "core/fxcrt/fx_basic.h" +#include "core/fxcrt/fx_coordinates.h" + +enum FXDIB_Format { + FXDIB_Invalid = 0, + FXDIB_1bppMask = 0x101, + FXDIB_1bppRgb = 0x001, + FXDIB_1bppCmyk = 0x401, + FXDIB_8bppMask = 0x108, + FXDIB_8bppRgb = 0x008, + FXDIB_8bppRgba = 0x208, + FXDIB_8bppCmyk = 0x408, + FXDIB_8bppCmyka = 0x608, + FXDIB_Rgb = 0x018, + FXDIB_Rgba = 0x218, + FXDIB_Rgb32 = 0x020, + FXDIB_Argb = 0x220, + FXDIB_Cmyk = 0x420, + FXDIB_Cmyka = 0x620, +}; + +enum FXDIB_Channel { + FXDIB_Red = 1, + FXDIB_Green, + FXDIB_Blue, + FXDIB_Cyan, + FXDIB_Magenta, + FXDIB_Yellow, + FXDIB_Black, + FXDIB_Alpha +}; + +#define FXDIB_DOWNSAMPLE 0x04 +#define FXDIB_INTERPOL 0x20 +#define FXDIB_BICUBIC_INTERPOL 0x80 +#define FXDIB_NOSMOOTH 0x100 +#define FXDIB_BLEND_NORMAL 0 +#define FXDIB_BLEND_MULTIPLY 1 +#define FXDIB_BLEND_SCREEN 2 +#define FXDIB_BLEND_OVERLAY 3 +#define FXDIB_BLEND_DARKEN 4 +#define FXDIB_BLEND_LIGHTEN 5 + +#define FXDIB_BLEND_COLORDODGE 6 +#define FXDIB_BLEND_COLORBURN 7 +#define FXDIB_BLEND_HARDLIGHT 8 +#define FXDIB_BLEND_SOFTLIGHT 9 +#define FXDIB_BLEND_DIFFERENCE 10 +#define FXDIB_BLEND_EXCLUSION 11 +#define FXDIB_BLEND_NONSEPARABLE 21 +#define FXDIB_BLEND_HUE 21 +#define FXDIB_BLEND_SATURATION 22 +#define FXDIB_BLEND_COLOR 23 +#define FXDIB_BLEND_LUMINOSITY 24 +#define FXDIB_BLEND_UNSUPPORTED -1 +typedef uint32_t FX_ARGB; +typedef uint32_t FX_COLORREF; +typedef uint32_t FX_CMYK; +class CFX_ClipRgn; +class CFX_DIBSource; +class CFX_DIBitmap; +class CStretchEngine; + +#define FXSYS_RGB(r, g, b) ((r) | ((g) << 8) | ((b) << 16)) +#define FXSYS_GetRValue(rgb) ((rgb)&0xff) +#define FXSYS_GetGValue(rgb) (((rgb) >> 8) & 0xff) +#define FXSYS_GetBValue(rgb) (((rgb) >> 16) & 0xff) +#define FX_CCOLOR(val) (255 - (val)) +#define FXSYS_CMYK(c, m, y, k) (((c) << 24) | ((m) << 16) | ((y) << 8) | (k)) +#define FXSYS_GetCValue(cmyk) ((uint8_t)((cmyk) >> 24) & 0xff) +#define FXSYS_GetMValue(cmyk) ((uint8_t)((cmyk) >> 16) & 0xff) +#define FXSYS_GetYValue(cmyk) ((uint8_t)((cmyk) >> 8) & 0xff) +#define FXSYS_GetKValue(cmyk) ((uint8_t)(cmyk)&0xff) +void CmykDecode(FX_CMYK cmyk, int& c, int& m, int& y, int& k); +inline FX_CMYK CmykEncode(int c, int m, int y, int k) { + return (c << 24) | (m << 16) | (y << 8) | k; +} +void ArgbDecode(FX_ARGB argb, int& a, int& r, int& g, int& b); +void ArgbDecode(FX_ARGB argb, int& a, FX_COLORREF& rgb); +inline FX_ARGB ArgbEncode(int a, int r, int g, int b) { + return (a << 24) | (r << 16) | (g << 8) | b; +} +FX_ARGB ArgbEncode(int a, FX_COLORREF rgb); +#define FXARGB_A(argb) ((uint8_t)((argb) >> 24)) +#define FXARGB_R(argb) ((uint8_t)((argb) >> 16)) +#define FXARGB_G(argb) ((uint8_t)((argb) >> 8)) +#define FXARGB_B(argb) ((uint8_t)(argb)) +#define FXARGB_MAKE(a, r, g, b) \ + (((uint32_t)(a) << 24) | ((r) << 16) | ((g) << 8) | (b)) +#define FXARGB_MUL_ALPHA(argb, alpha) \ + (((((argb) >> 24) * (alpha) / 255) << 24) | ((argb)&0xffffff)) +#define FXRGB2GRAY(r, g, b) (((b)*11 + (g)*59 + (r)*30) / 100) +#define FXCMYK2GRAY(c, m, y, k) \ + (((255 - (c)) * (255 - (k)) * 30 + (255 - (m)) * (255 - (k)) * 59 + \ + (255 - (y)) * (255 - (k)) * 11) / \ + 25500) +#define FXDIB_ALPHA_MERGE(backdrop, source, source_alpha) \ + (((backdrop) * (255 - (source_alpha)) + (source) * (source_alpha)) / 255) +#define FXDIB_ALPHA_UNION(dest, src) ((dest) + (src) - (dest) * (src) / 255) +#define FXCMYK_GETDIB(p) \ + ((((uint8_t*)(p))[0] << 24 | (((uint8_t*)(p))[1] << 16) | \ + (((uint8_t*)(p))[2] << 8) | ((uint8_t*)(p))[3])) +#define FXCMYK_SETDIB(p, cmyk) ((uint8_t*)(p))[0] = (uint8_t)((cmyk) >> 24), \ + ((uint8_t*)(p))[1] = (uint8_t)((cmyk) >> 16), \ + ((uint8_t*)(p))[2] = (uint8_t)((cmyk) >> 8), \ + ((uint8_t*)(p))[3] = (uint8_t)(cmyk)) +#define FXARGB_GETDIB(p) \ + ((((uint8_t*)(p))[0]) | (((uint8_t*)(p))[1] << 8) | \ + (((uint8_t*)(p))[2] << 16) | (((uint8_t*)(p))[3] << 24)) +#define FXARGB_SETDIB(p, argb) \ + ((uint8_t*)(p))[0] = (uint8_t)(argb), \ + ((uint8_t*)(p))[1] = (uint8_t)((argb) >> 8), \ + ((uint8_t*)(p))[2] = (uint8_t)((argb) >> 16), \ + ((uint8_t*)(p))[3] = (uint8_t)((argb) >> 24) +#define FXARGB_COPY(dest, src) \ + *(uint8_t*)(dest) = *(uint8_t*)(src), \ + *((uint8_t*)(dest) + 1) = *((uint8_t*)(src) + 1), \ + *((uint8_t*)(dest) + 2) = *((uint8_t*)(src) + 2), \ + *((uint8_t*)(dest) + 3) = *((uint8_t*)(src) + 3) +#define FXCMYK_COPY(dest, src) \ + *(uint8_t*)(dest) = *(uint8_t*)(src), \ + *((uint8_t*)(dest) + 1) = *((uint8_t*)(src) + 1), \ + *((uint8_t*)(dest) + 2) = *((uint8_t*)(src) + 2), \ + *((uint8_t*)(dest) + 3) = *((uint8_t*)(src) + 3) +#define FXARGB_SETRGBORDERDIB(p, argb) \ + ((uint8_t*)(p))[3] = (uint8_t)(argb >> 24), \ + ((uint8_t*)(p))[0] = (uint8_t)((argb) >> 16), \ + ((uint8_t*)(p))[1] = (uint8_t)((argb) >> 8), \ + ((uint8_t*)(p))[2] = (uint8_t)(argb) +#define FXARGB_GETRGBORDERDIB(p) \ + (((uint8_t*)(p))[2]) | (((uint8_t*)(p))[1] << 8) | \ + (((uint8_t*)(p))[0] << 16) | (((uint8_t*)(p))[3] << 24) +#define FXARGB_RGBORDERCOPY(dest, src) \ + *((uint8_t*)(dest) + 3) = *((uint8_t*)(src) + 3), \ + *(uint8_t*)(dest) = *((uint8_t*)(src) + 2), \ + *((uint8_t*)(dest) + 1) = *((uint8_t*)(src) + 1), \ + *((uint8_t*)(dest) + 2) = *((uint8_t*)(src)) +#define FXARGB_TODIB(argb) (argb) +#define FXCMYK_TODIB(cmyk) \ + ((uint8_t)((cmyk) >> 24) | ((uint8_t)((cmyk) >> 16)) << 8 | \ + ((uint8_t)((cmyk) >> 8)) << 16 | ((uint8_t)(cmyk) << 24)) +#define FXARGB_TOBGRORDERDIB(argb) \ + ((uint8_t)(argb >> 16) | ((uint8_t)(argb >> 8)) << 8 | \ + ((uint8_t)(argb)) << 16 | ((uint8_t)(argb >> 24) << 24)) +#define FXGETFLAG_COLORTYPE(flag) (uint8_t)((flag) >> 8) +#define FXGETFLAG_ALPHA_FILL(flag) (uint8_t)(flag) + +FX_BOOL ConvertBuffer(FXDIB_Format dest_format, + uint8_t* dest_buf, + int dest_pitch, + int width, + int height, + const CFX_DIBSource* pSrcBitmap, + int src_left, + int src_top, + std::unique_ptr* pal); + +class CFX_DIBSource { + public: + virtual ~CFX_DIBSource(); + + virtual uint8_t* GetBuffer() const; + virtual const uint8_t* GetScanline(int line) const = 0; + virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const; + virtual void DownSampleScanline(int line, + uint8_t* dest_scan, + int dest_bpp, + int dest_width, + FX_BOOL bFlipX, + int clip_left, + int clip_width) const = 0; + + int GetWidth() const { return m_Width; } + int GetHeight() const { return m_Height; } + + FXDIB_Format GetFormat() const { + return (FXDIB_Format)(m_AlphaFlag * 0x100 + m_bpp); + } + uint32_t GetPitch() const { return m_Pitch; } + uint32_t* GetPalette() const { return m_pPalette.get(); } + int GetBPP() const { return m_bpp; } + + // TODO(thestig): Investigate this. Given the possible values of FXDIB_Format, + // it feels as though this should be implemented as !!(m_AlphaFlag & 1) and + // IsOpaqueImage() below should never be able to return TRUE. + bool IsAlphaMask() const { return m_AlphaFlag == 1; } + bool HasAlpha() const { return !!(m_AlphaFlag & 2); } + bool IsOpaqueImage() const { return !(m_AlphaFlag & 3); } + bool IsCmykImage() const { return !!(m_AlphaFlag & 4); } + + int GetPaletteSize() const { + return IsAlphaMask() ? 0 : (m_bpp == 1 ? 2 : (m_bpp == 8 ? 256 : 0)); + } + + uint32_t GetPaletteEntry(int index) const; + + void SetPaletteEntry(int index, uint32_t color); + uint32_t GetPaletteArgb(int index) const { return GetPaletteEntry(index); } + void SetPaletteArgb(int index, uint32_t color) { + SetPaletteEntry(index, color); + } + + void CopyPalette(const uint32_t* pSrcPal); + + CFX_DIBitmap* Clone(const FX_RECT* pClip = nullptr) const; + CFX_DIBitmap* CloneConvert(FXDIB_Format format) const; + + CFX_DIBitmap* StretchTo(int dest_width, + int dest_height, + uint32_t flags = 0, + const FX_RECT* pClip = nullptr) const; + CFX_DIBitmap* TransformTo(const CFX_Matrix* pMatrix, + int& left, + int& top, + uint32_t flags = 0, + const FX_RECT* pClip = nullptr) const; + + CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = nullptr) const; + FX_BOOL CopyAlphaMask(const CFX_DIBSource* pAlphaMask, + const FX_RECT* pClip = nullptr); + + CFX_DIBitmap* SwapXY(FX_BOOL bXFlip, + FX_BOOL bYFlip, + const FX_RECT* pClip = nullptr) const; + + CFX_DIBitmap* FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const; + + void GetOverlapRect(int& dest_left, + int& dest_top, + int& width, + int& height, + int src_width, + int src_height, + int& src_left, + int& src_top, + const CFX_ClipRgn* pClipRgn); + +#if defined _SKIA_SUPPORT_ + void DebugVerifyBitmapIsPreMultiplied(void* buffer = nullptr) const; +#endif + + CFX_DIBitmap* m_pAlphaMask; + + protected: + CFX_DIBSource(); + + void BuildPalette(); + FX_BOOL BuildAlphaMask(); + int FindPalette(uint32_t color) const; + void GetPalette(uint32_t* pal, int alpha) const; + + int m_Width; + int m_Height; + int m_bpp; + uint32_t m_AlphaFlag; + uint32_t m_Pitch; + // TODO(weili): Use std::vector for this. + std::unique_ptr m_pPalette; +}; + +class CFX_DIBitmap : public CFX_DIBSource { + public: + CFX_DIBitmap(); + explicit CFX_DIBitmap(const CFX_DIBitmap& src); + ~CFX_DIBitmap() override; + + FX_BOOL Create(int width, + int height, + FXDIB_Format format, + uint8_t* pBuffer = nullptr, + int pitch = 0); + + FX_BOOL Copy(const CFX_DIBSource* pSrc); + + // CFX_DIBSource + uint8_t* GetBuffer() const override; + const uint8_t* GetScanline(int line) const override; + void DownSampleScanline(int line, + uint8_t* dest_scan, + int dest_bpp, + int dest_width, + FX_BOOL bFlipX, + int clip_left, + int clip_width) const override; + + void TakeOver(CFX_DIBitmap* pSrcBitmap); + + FX_BOOL ConvertFormat(FXDIB_Format format); + + void Clear(uint32_t color); + + uint32_t GetPixel(int x, int y) const; + + void SetPixel(int x, int y, uint32_t color); + + FX_BOOL LoadChannel(FXDIB_Channel destChannel, + const CFX_DIBSource* pSrcBitmap, + FXDIB_Channel srcChannel); + + FX_BOOL LoadChannel(FXDIB_Channel destChannel, int value); + + FX_BOOL MultiplyAlpha(int alpha); + + FX_BOOL MultiplyAlpha(const CFX_DIBSource* pAlphaMask); + + FX_BOOL TransferBitmap(int dest_left, + int dest_top, + int width, + int height, + const CFX_DIBSource* pSrcBitmap, + int src_left, + int src_top); + + FX_BOOL CompositeBitmap(int dest_left, + int dest_top, + int width, + int height, + const CFX_DIBSource* pSrcBitmap, + int src_left, + int src_top, + int blend_type = FXDIB_BLEND_NORMAL, + const CFX_ClipRgn* pClipRgn = nullptr, + FX_BOOL bRgbByteOrder = FALSE, + void* pIccTransform = nullptr); + + FX_BOOL TransferMask(int dest_left, + int dest_top, + int width, + int height, + const CFX_DIBSource* pMask, + uint32_t color, + int src_left, + int src_top, + int alpha_flag = 0, + void* pIccTransform = nullptr); + + FX_BOOL CompositeMask(int dest_left, + int dest_top, + int width, + int height, + const CFX_DIBSource* pMask, + uint32_t color, + int src_left, + int src_top, + int blend_type = FXDIB_BLEND_NORMAL, + const CFX_ClipRgn* pClipRgn = nullptr, + FX_BOOL bRgbByteOrder = FALSE, + int alpha_flag = 0, + void* pIccTransform = nullptr); + + FX_BOOL CompositeRect(int dest_left, + int dest_top, + int width, + int height, + uint32_t color, + int alpha_flag = 0, + void* pIccTransform = nullptr); + + FX_BOOL ConvertColorScale(uint32_t forecolor, uint32_t backcolor); + + protected: + FX_BOOL GetGrayData(void* pIccTransform = nullptr); + + uint8_t* m_pBuffer; + FX_BOOL m_bExtBuf; +}; + +class CFX_DIBExtractor { + public: + explicit CFX_DIBExtractor(const CFX_DIBSource* pSrc); + ~CFX_DIBExtractor(); + + CFX_DIBitmap* GetBitmap() { return m_pBitmap.get(); } + + private: + std::unique_ptr m_pBitmap; +}; + +typedef CFX_CountRef CFX_DIBitmapRef; + +class CFX_FilteredDIB : public CFX_DIBSource { + public: + CFX_FilteredDIB(); + ~CFX_FilteredDIB() override; + + void LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc = FALSE); + + virtual FXDIB_Format GetDestFormat() = 0; + + virtual uint32_t* GetDestPalette() = 0; + + virtual void TranslateScanline(const uint8_t* src_buf, + std::vector* dest_buf) const = 0; + + virtual void TranslateDownSamples(uint8_t* dest_buf, + const uint8_t* src_buf, + int pixels, + int Bpp) const = 0; + + protected: + // CFX_DIBSource + const uint8_t* GetScanline(int line) const override; + void DownSampleScanline(int line, + uint8_t* dest_scan, + int dest_bpp, + int dest_width, + FX_BOOL bFlipX, + int clip_left, + int clip_width) const override; + + const CFX_DIBSource* m_pSrc; + FX_BOOL m_bAutoDropSrc; + mutable std::vector m_Scanline; +}; + +class IFX_ScanlineComposer { + public: + virtual ~IFX_ScanlineComposer() {} + + virtual void ComposeScanline(int line, + const uint8_t* scanline, + const uint8_t* scan_extra_alpha = nullptr) = 0; + + virtual FX_BOOL SetInfo(int width, + int height, + FXDIB_Format src_format, + uint32_t* pSrcPalette) = 0; +}; + +class CFX_ScanlineCompositor { + public: + CFX_ScanlineCompositor(); + + ~CFX_ScanlineCompositor(); + + FX_BOOL Init(FXDIB_Format dest_format, + FXDIB_Format src_format, + int32_t width, + uint32_t* pSrcPalette, + uint32_t mask_color, + int blend_type, + FX_BOOL bClip, + FX_BOOL bRgbByteOrder = FALSE, + int alpha_flag = 0, + void* pIccTransform = nullptr); + + void CompositeRgbBitmapLine(uint8_t* dest_scan, + const uint8_t* src_scan, + int width, + const uint8_t* clip_scan, + const uint8_t* src_extra_alpha = nullptr, + uint8_t* dst_extra_alpha = nullptr); + + void CompositePalBitmapLine(uint8_t* dest_scan, + const uint8_t* src_scan, + int src_left, + int width, + const uint8_t* clip_scan, + const uint8_t* src_extra_alpha = nullptr, + uint8_t* dst_extra_alpha = nullptr); + + void CompositeByteMaskLine(uint8_t* dest_scan, + const uint8_t* src_scan, + int width, + const uint8_t* clip_scan, + uint8_t* dst_extra_alpha = nullptr); + + void CompositeBitMaskLine(uint8_t* dest_scan, + const uint8_t* src_scan, + int src_left, + int width, + const uint8_t* clip_scan, + uint8_t* dst_extra_alpha = nullptr); + + protected: + int m_Transparency; + FXDIB_Format m_SrcFormat, m_DestFormat; + uint32_t* m_pSrcPalette; + + int m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue, m_MaskBlack; + int m_BlendType; + void* m_pIccTransform; + uint8_t* m_pCacheScanline; + int m_CacheSize; + FX_BOOL m_bRgbByteOrder; +}; + +class CFX_BitmapComposer : public IFX_ScanlineComposer { + public: + CFX_BitmapComposer(); + ~CFX_BitmapComposer() override; + + void Compose(CFX_DIBitmap* pDest, + const CFX_ClipRgn* pClipRgn, + int bitmap_alpha, + uint32_t mask_color, + FX_RECT& dest_rect, + FX_BOOL bVertical, + FX_BOOL bFlipX, + FX_BOOL bFlipY, + FX_BOOL bRgbByteOrder = FALSE, + int alpha_flag = 0, + void* pIccTransform = nullptr, + int blend_type = FXDIB_BLEND_NORMAL); + + // IFX_ScanlineComposer + FX_BOOL SetInfo(int width, + int height, + FXDIB_Format src_format, + uint32_t* pSrcPalette) override; + + void ComposeScanline(int line, + const uint8_t* scanline, + const uint8_t* scan_extra_alpha) override; + + protected: + void DoCompose(uint8_t* dest_scan, + const uint8_t* src_scan, + int dest_width, + const uint8_t* clip_scan, + const uint8_t* src_extra_alpha = nullptr, + uint8_t* dst_extra_alpha = nullptr); + CFX_DIBitmap* m_pBitmap; + const CFX_ClipRgn* m_pClipRgn; + FXDIB_Format m_SrcFormat; + int m_DestLeft, m_DestTop, m_DestWidth, m_DestHeight, m_BitmapAlpha; + uint32_t m_MaskColor; + const CFX_DIBitmap* m_pClipMask; + CFX_ScanlineCompositor m_Compositor; + FX_BOOL m_bVertical, m_bFlipX, m_bFlipY; + int m_AlphaFlag; + void* m_pIccTransform; + FX_BOOL m_bRgbByteOrder; + int m_BlendType; + void ComposeScanlineV(int line, + const uint8_t* scanline, + const uint8_t* scan_extra_alpha = nullptr); + uint8_t* m_pScanlineV; + uint8_t* m_pClipScanV; + uint8_t* m_pAddClipScan; + uint8_t* m_pScanlineAlphaV; +}; + +class CFX_BitmapStorer : public IFX_ScanlineComposer { + public: + CFX_BitmapStorer(); + ~CFX_BitmapStorer() override; + + // IFX_ScanlineComposer + void ComposeScanline(int line, + const uint8_t* scanline, + const uint8_t* scan_extra_alpha) override; + FX_BOOL SetInfo(int width, + int height, + FXDIB_Format src_format, + uint32_t* pSrcPalette) override; + + CFX_DIBitmap* GetBitmap() { return m_pBitmap.get(); } + std::unique_ptr Detach(); + void Replace(std::unique_ptr pBitmap); + + private: + std::unique_ptr m_pBitmap; +}; + +class CFX_ImageStretcher { + public: + CFX_ImageStretcher(IFX_ScanlineComposer* pDest, + const CFX_DIBSource* pSource, + int dest_width, + int dest_height, + const FX_RECT& bitmap_rect, + uint32_t flags); + ~CFX_ImageStretcher(); + + FX_BOOL Start(); + FX_BOOL Continue(IFX_Pause* pPause); + + const CFX_DIBSource* source() { return m_pSource; } + + private: + FX_BOOL StartQuickStretch(); + FX_BOOL StartStretch(); + FX_BOOL ContinueQuickStretch(IFX_Pause* pPause); + FX_BOOL ContinueStretch(IFX_Pause* pPause); + + IFX_ScanlineComposer* const m_pDest; + const CFX_DIBSource* const m_pSource; + std::unique_ptr m_pStretchEngine; + std::unique_ptr m_pScanline; + std::unique_ptr m_pMaskScanline; + const uint32_t m_Flags; + FX_BOOL m_bFlipX; + FX_BOOL m_bFlipY; + int m_DestWidth; + int m_DestHeight; + FX_RECT m_ClipRect; + const FXDIB_Format m_DestFormat; + const int m_DestBPP; + int m_LineIndex; +}; + +class CFX_ImageTransformer { + public: + CFX_ImageTransformer(const CFX_DIBSource* pSrc, + const CFX_Matrix* pMatrix, + int flags, + const FX_RECT* pClip); + ~CFX_ImageTransformer(); + + FX_BOOL Start(); + FX_BOOL Continue(IFX_Pause* pPause); + + const FX_RECT& result() const { return m_result; } + std::unique_ptr DetachBitmap(); + + private: + const CFX_DIBSource* const m_pSrc; + const CFX_Matrix* const m_pMatrix; + const FX_RECT* const m_pClip; + FX_RECT m_StretchClip; + FX_RECT m_result; + CFX_Matrix m_dest2stretch; + std::unique_ptr m_Stretcher; + CFX_BitmapStorer m_Storer; + const uint32_t m_Flags; + int m_Status; +}; + +class CFX_ImageRenderer { + public: + CFX_ImageRenderer(); + ~CFX_ImageRenderer(); + + FX_BOOL Start(CFX_DIBitmap* pDevice, + const CFX_ClipRgn* pClipRgn, + const CFX_DIBSource* pSource, + int bitmap_alpha, + uint32_t mask_color, + const CFX_Matrix* pMatrix, + uint32_t dib_flags, + FX_BOOL bRgbByteOrder = FALSE, + int alpha_flag = 0, + void* pIccTransform = nullptr, + int blend_type = FXDIB_BLEND_NORMAL); + + FX_BOOL Continue(IFX_Pause* pPause); + + protected: + CFX_DIBitmap* m_pDevice; + const CFX_ClipRgn* m_pClipRgn; + int m_BitmapAlpha; + uint32_t m_MaskColor; + CFX_Matrix m_Matrix; + std::unique_ptr m_pTransformer; + std::unique_ptr m_Stretcher; + CFX_BitmapComposer m_Composer; + int m_Status; + FX_RECT m_ClipBox; + uint32_t m_Flags; + int m_AlphaFlag; + void* m_pIccTransform; + FX_BOOL m_bRgbByteOrder; + int m_BlendType; +}; + +#endif // CORE_FXGE_FX_DIB_H_ diff --git a/core/fxge/fx_font.h b/core/fxge/fx_font.h new file mode 100644 index 0000000000..8dda12af50 --- /dev/null +++ b/core/fxge/fx_font.h @@ -0,0 +1,248 @@ +// 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_FXGE_FX_FONT_H_ +#define CORE_FXGE_FX_FONT_H_ + +#include +#include + +#include "core/fxcrt/fx_system.h" +#include "core/fxge/cfx_substfont.h" +#include "core/fxge/fx_dib.h" +#include "core/fxge/fx_freetype.h" + +typedef struct FT_FaceRec_* FXFT_Face; +typedef void* FXFT_Library; + +class CFX_FaceCache; +class CFX_GlyphBitmap; +class CFX_PathData; +class CFX_SizeGlyphCache; + +#ifdef _SKIA_SUPPORT_ +class SkTypeface; + +using CFX_TypeFace = SkTypeface; +#endif + +/* Character sets for the font */ +#define FXFONT_ANSI_CHARSET 0 +#define FXFONT_DEFAULT_CHARSET 1 +#define FXFONT_SYMBOL_CHARSET 2 +#define FXFONT_SHIFTJIS_CHARSET 128 +#define FXFONT_HANGUL_CHARSET 129 +#define FXFONT_GB2312_CHARSET 134 +#define FXFONT_CHINESEBIG5_CHARSET 136 +#define FXFONT_THAI_CHARSET 222 +#define FXFONT_EASTEUROPE_CHARSET 238 +#define FXFONT_RUSSIAN_CHARSET 204 +#define FXFONT_GREEK_CHARSET 161 +#define FXFONT_TURKISH_CHARSET 162 +#define FXFONT_HEBREW_CHARSET 177 +#define FXFONT_ARABIC_CHARSET 178 +#define FXFONT_BALTIC_CHARSET 186 +#define FXFONT_JOHAB_CHARSET 130 +#define FXFONT_VIETNAMESE_CHARSET 163 + +/* Font pitch and family flags */ +#define FXFONT_FF_FIXEDPITCH 1 +#define FXFONT_FF_ROMAN (1 << 4) +#define FXFONT_FF_SCRIPT (4 << 4) + +/* Typical weight values */ +#define FXFONT_FW_NORMAL 400 +#define FXFONT_FW_BOLD 700 + +/* Font styles */ +#define FXFONT_FIXED_PITCH 0x01 +#define FXFONT_SERIF 0x02 +#define FXFONT_SYMBOLIC 0x04 +#define FXFONT_SCRIPT 0x08 +#define FXFONT_ITALIC 0x40 +#define FXFONT_BOLD 0x40000 +#define FXFONT_USEEXTERNATTR 0x80000 +#define FXFONT_CIDFONT 0x100000 +#ifdef PDF_ENABLE_XFA +#define FXFONT_EXACTMATCH 0x80000000 +#endif // PDF_ENABLE_XFA + +#define CHARSET_FLAG_ANSI 1 +#define CHARSET_FLAG_SYMBOL 2 +#define CHARSET_FLAG_SHIFTJIS 4 +#define CHARSET_FLAG_BIG5 8 +#define CHARSET_FLAG_GB 16 +#define CHARSET_FLAG_KOREAN 32 + +#define GET_TT_SHORT(w) (uint16_t)(((w)[0] << 8) | (w)[1]) +#define GET_TT_LONG(w) \ + (uint32_t)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3]) + +// Sets the given transform on the font, and resets it to the identity when it +// goes out of scope. +class ScopedFontTransform { + public: + ScopedFontTransform(FT_Face face, FXFT_Matrix* matrix); + ~ScopedFontTransform(); + + private: + FT_Face m_Face; +}; + +class CFX_Font { + public: + CFX_Font(); + ~CFX_Font(); + + void LoadSubst(const CFX_ByteString& face_name, + FX_BOOL bTrueType, + uint32_t flags, + int weight, + int italic_angle, + int CharsetCP, + bool bVertical); + + FX_BOOL LoadEmbedded(const uint8_t* data, uint32_t size); + FXFT_Face GetFace() const { return m_Face; } + CFX_SubstFont* GetSubstFont() const { return m_pSubstFont.get(); } + +#ifdef PDF_ENABLE_XFA + FX_BOOL LoadFile(IFX_FileRead* pFile, + int nFaceIndex = 0, + int* pFaceCount = nullptr); + + FX_BOOL LoadClone(const CFX_Font* pFont); + void SetFace(FXFT_Face face); + void SetSubstFont(std::unique_ptr subst) { + m_pSubstFont = std::move(subst); + } +#endif // PDF_ENABLE_XFA + + const CFX_GlyphBitmap* LoadGlyphBitmap(uint32_t glyph_index, + FX_BOOL bFontStyle, + const CFX_Matrix* pMatrix, + int dest_width, + int anti_alias, + int& text_flags) const; + const CFX_PathData* LoadGlyphPath(uint32_t glyph_index, int dest_width) const; + +#ifdef _SKIA_SUPPORT_ + CFX_TypeFace* GetDeviceCache() const; +#endif + + int GetGlyphWidth(uint32_t glyph_index); + int GetAscent() const; + int GetDescent() const; + FX_BOOL GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox); + bool IsItalic() const; + bool IsBold() const; + bool IsFixedWidth() const; + bool IsVertical() const { return m_bVertical; } + CFX_ByteString GetPsName() const; + CFX_ByteString GetFamilyName() const; + CFX_ByteString GetFaceName() const; + bool IsTTFont() const; + FX_BOOL GetBBox(FX_RECT& bbox); + int GetHeight() const; + int GetULPos() const; + int GetULthickness() const; + int GetMaxAdvanceWidth() const; + FX_BOOL IsEmbedded() const { return m_bEmbedded; } + uint8_t* GetSubData() const { return m_pGsubData; } + void SetSubData(uint8_t* data) { m_pGsubData = data; } +#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ + void* GetPlatformFont() const { return m_pPlatformFont; } + void SetPlatformFont(void* font) { m_pPlatformFont = font; } +#endif + uint8_t* GetFontData() const { return m_pFontData; } + uint32_t GetSize() const { return m_dwSize; } + void AdjustMMParams(int glyph_index, int width, int weight) const; + + static const size_t kAngleSkewArraySize = 30; + static const char s_AngleSkew[kAngleSkewArraySize]; + static const size_t kWeightPowArraySize = 100; + static const uint8_t s_WeightPow[kWeightPowArraySize]; + static const uint8_t s_WeightPow_11[kWeightPowArraySize]; + static const uint8_t s_WeightPow_SHIFTJIS[kWeightPowArraySize]; + +#ifdef PDF_ENABLE_XFA + protected: + CFX_BinaryBuf m_OtfFontData; + bool m_bShallowCopy; + FXFT_StreamRec* m_pOwnedStream; +#endif // PDF_ENABLE_XFA + + private: + friend class CFX_FaceCache; + CFX_PathData* LoadGlyphPathImpl(uint32_t glyph_index, + int dest_width = 0) const; + + private: + CFX_FaceCache* GetFaceCache() const; + + void ReleasePlatformResource(); + void DeleteFace(); + + void ClearFaceCache(); + + FXFT_Face m_Face; + mutable CFX_FaceCache* m_FaceCache; // not owned. + std::unique_ptr m_pSubstFont; + std::vector m_pFontDataAllocation; + uint8_t* m_pFontData; + uint8_t* m_pGsubData; + uint32_t m_dwSize; +#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ + void* m_pPlatformFont; +#endif + bool m_bEmbedded; + bool m_bVertical; +}; + +class CFX_FontFaceInfo { + public: + CFX_FontFaceInfo(CFX_ByteString filePath, + CFX_ByteString faceName, + CFX_ByteString fontTables, + uint32_t fontOffset, + uint32_t fileSize); + + const CFX_ByteString m_FilePath; + const CFX_ByteString m_FaceName; + const CFX_ByteString m_FontTables; + const uint32_t m_FontOffset; + const uint32_t m_FileSize; + uint32_t m_Styles; + uint32_t m_Charsets; +}; + +class CFX_GlyphBitmap { + public: + int m_Top; + int m_Left; + CFX_DIBitmap m_Bitmap; +}; + +struct FXTEXT_GLYPHPOS { + const CFX_GlyphBitmap* m_pGlyph; + int m_OriginX; + int m_OriginY; + FX_FLOAT m_fOriginX; + FX_FLOAT m_fOriginY; +}; + +FX_RECT FXGE_GetGlyphsBBox(const std::vector& glyphs, + int anti_alias, + FX_FLOAT retinaScaleX = 1.0f, + FX_FLOAT retinaScaleY = 1.0f); + +CFX_ByteString GetNameFromTT(const uint8_t* name_table, + uint32_t name_table_size, + uint32_t name); + +int PDF_GetStandardFontName(CFX_ByteString* name); + +#endif // CORE_FXGE_FX_FONT_H_ diff --git a/core/fxge/fx_freetype.h b/core/fxge/fx_freetype.h new file mode 100644 index 0000000000..8ead6b755c --- /dev/null +++ b/core/fxge/fx_freetype.h @@ -0,0 +1,180 @@ +// 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_FXGE_FX_FREETYPE_H_ +#define CORE_FXGE_FX_FREETYPE_H_ + +#include +#include FT_FREETYPE_H +#include FT_GLYPH_H +#include FT_LCD_FILTER_H +#include FT_MULTIPLE_MASTERS_H +#include FT_OUTLINE_H +#include FT_TRUETYPE_TABLES_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define FXFT_ENCODING_UNICODE FT_ENCODING_UNICODE +#define FXFT_ENCODING_ADOBE_STANDARD FT_ENCODING_ADOBE_STANDARD +#define FXFT_ENCODING_ADOBE_EXPERT FT_ENCODING_ADOBE_EXPERT +#define FXFT_ENCODING_ADOBE_LATIN_1 FT_ENCODING_ADOBE_LATIN_1 +#define FXFT_ENCODING_APPLE_ROMAN FT_ENCODING_APPLE_ROMAN +#define FXFT_ENCODING_ADOBE_CUSTOM FT_ENCODING_ADOBE_CUSTOM +#define FXFT_ENCODING_MS_SYMBOL FT_ENCODING_MS_SYMBOL +#define FXFT_ENCODING_GB2312 FT_ENCODING_GB2312 +#define FXFT_ENCODING_BIG5 FT_ENCODING_BIG5 +#define FXFT_ENCODING_SJIS FT_ENCODING_SJIS +#define FXFT_ENCODING_JOHAB FT_ENCODING_JOHAB +#define FXFT_ENCODING_WANSUNG FT_ENCODING_WANSUNG +#define FXFT_LOAD_NO_SCALE FT_LOAD_NO_SCALE +#define FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH \ + FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH +#define FXFT_RENDER_MODE_LCD FT_RENDER_MODE_LCD +#define FXFT_RENDER_MODE_MONO FT_RENDER_MODE_MONO +#define FXFT_RENDER_MODE_NORMAL FT_RENDER_MODE_NORMAL +#define FXFT_LOAD_IGNORE_TRANSFORM FT_LOAD_IGNORE_TRANSFORM +#define FXFT_LOAD_NO_BITMAP FT_LOAD_NO_BITMAP +#define FXFT_LOAD_NO_HINTING FT_LOAD_NO_HINTING +#define FXFT_PIXEL_MODE_MONO FT_PIXEL_MODE_MONO +#define FXFT_STYLE_FLAG_ITALIC FT_STYLE_FLAG_ITALIC +#define FXFT_STYLE_FLAG_BOLD FT_STYLE_FLAG_BOLD +#define FXFT_FACE_FLAG_SFNT FT_FACE_FLAG_SFNT +#define FXFT_FACE_FLAG_TRICKY (1L << 13) +typedef FT_MM_Var* FXFT_MM_Var; +typedef FT_Bitmap* FXFT_Bitmap; +#define FXFT_Matrix FT_Matrix +#define FXFT_Vector FT_Vector +#define FXFT_Outline_Funcs FT_Outline_Funcs +typedef FT_Open_Args FXFT_Open_Args; +typedef FT_StreamRec FXFT_StreamRec; +typedef FT_StreamRec* FXFT_Stream; +typedef FT_BBox FXFT_BBox; +typedef FT_Glyph FXFT_Glyph; +typedef FT_CharMap FXFT_CharMap; +#define FXFT_GLYPH_BBOX_PIXELS FT_GLYPH_BBOX_PIXELS +#define FXFT_Open_Face(library, args, index, face) \ + FT_Open_Face((FT_Library)(library), args, index, (FT_Face*)(face)) +#define FXFT_Done_Face(face) FT_Done_Face((FT_Face)(face)) +#define FXFT_Done_FreeType(library) FT_Done_FreeType((FT_Library)(library)) +#define FXFT_Init_FreeType(library) FT_Init_FreeType((FT_Library*)(library)) +#define FXFT_New_Memory_Face(library, base, size, index, face) \ + FT_New_Memory_Face((FT_Library)(library), base, size, index, (FT_Face*)(face)) +#define FXFT_New_Face(library, filename, index, face) \ + FT_New_Face((FT_Library)(library), filename, index, (FT_Face*)(face)) +#define FXFT_Get_Face_FreeType(face) ((FT_Face)face)->driver->root.library +#define FXFT_Select_Charmap(face, encoding) \ + FT_Select_Charmap((FT_Face)face, (FT_Encoding)encoding) +#define FXFT_Set_Charmap(face, charmap) \ + FT_Set_Charmap((FT_Face)face, (FT_CharMap)charmap) +#define FXFT_Load_Glyph(face, glyph_index, flags) \ + FT_Load_Glyph((FT_Face)face, glyph_index, flags) +#define FXFT_Get_Char_Index(face, code) FT_Get_Char_Index((FT_Face)face, code) +#define FXFT_Get_Glyph_Name(face, index, buffer, size) \ + FT_Get_Glyph_Name((FT_Face)face, index, buffer, size) +#define FXFT_Get_Name_Index(face, name) FT_Get_Name_Index((FT_Face)face, name) +#define FXFT_Has_Glyph_Names(face) \ + (((FT_Face)face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES) +#define FXFT_Get_Postscript_Name(face) FT_Get_Postscript_Name((FT_Face)face) +#define FXFT_Load_Sfnt_Table(face, tag, offset, buffer, length) \ + FT_Load_Sfnt_Table((FT_Face)face, tag, offset, buffer, length) +#define FXFT_Get_First_Char(face, glyph_index) \ + FT_Get_First_Char((FT_Face)face, glyph_index) +#define FXFT_Get_Next_Char(face, code, glyph_index) \ + FT_Get_Next_Char((FT_Face)face, code, glyph_index) +#define FXFT_Clear_Face_External_Stream(face) \ + (((FT_Face)face)->face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM) +#define FXFT_Get_Face_External_Stream(face) \ + (((FT_Face)face)->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM) +#define FXFT_Is_Face_TT_OT(face) \ + (((FT_Face)face)->face_flags & FT_FACE_FLAG_SFNT) +#define FXFT_Is_Face_Tricky(face) \ + (((FT_Face)face)->face_flags & FXFT_FACE_FLAG_TRICKY) +#define FXFT_Is_Face_fixedwidth(face) \ + (((FT_Face)face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH) +#define FXFT_Get_Face_Stream_Base(face) ((FT_Face)face)->stream->base +#define FXFT_Get_Face_Stream_Size(face) ((FT_Face)face)->stream->size +#define FXFT_Get_Face_Family_Name(face) ((FT_Face)face)->family_name +#define FXFT_Get_Face_Style_Name(face) ((FT_Face)face)->style_name +#define FXFT_Get_Face_Numfaces(face) ((FT_Face)face)->num_faces +#define FXFT_Get_Face_Faceindex(face) ((FT_Face)face)->face_index +#define FXFT_Is_Face_Italic(face) \ + (((FT_Face)face)->style_flags & FT_STYLE_FLAG_ITALIC) +#define FXFT_Is_Face_Bold(face) \ + (((FT_Face)face)->style_flags & FT_STYLE_FLAG_BOLD) +#define FXFT_Get_Face_Charmaps(face) ((FT_Face)face)->charmaps +#define FXFT_Get_Glyph_HoriBearingX(face) \ + ((FT_Face)face)->glyph->metrics.horiBearingX +#define FXFT_Get_Glyph_HoriBearingY(face) \ + ((FT_Face)face)->glyph->metrics.horiBearingY +#define FXFT_Get_Glyph_Width(face) ((FT_Face)face)->glyph->metrics.width +#define FXFT_Get_Glyph_Height(face) ((FT_Face)face)->glyph->metrics.height +#define FXFT_Get_Face_CharmapCount(face) ((FT_Face)face)->num_charmaps +#define FXFT_Get_Charmap_Encoding(charmap) ((FT_CharMap)charmap)->encoding +#define FXFT_Get_Face_Charmap(face) ((FT_Face)face)->charmap +#define FXFT_Get_Charmap_PlatformID(charmap) ((FT_CharMap)charmap)->platform_id +#define FXFT_Get_Charmap_EncodingID(charmap) ((FT_CharMap)charmap)->encoding_id +#define FXFT_Get_Face_UnitsPerEM(face) ((FT_Face)face)->units_per_EM +#define FXFT_Get_Face_xMin(face) ((FT_Face)face)->bbox.xMin +#define FXFT_Get_Face_xMax(face) ((FT_Face)face)->bbox.xMax +#define FXFT_Get_Face_yMin(face) ((FT_Face)face)->bbox.yMin +#define FXFT_Get_Face_yMax(face) ((FT_Face)face)->bbox.yMax +#define FXFT_Get_Face_Height(face) ((FT_Face)face)->height +#define FXFT_Get_Face_UnderLineThickness(face) \ + ((FT_Face)face)->underline_thickness +#define FXFT_Get_Face_UnderLinePosition(face) \ + ((FT_Face)face)->underline_position +#define FXFT_Get_Face_MaxAdvanceWidth(face) ((FT_Face)face)->max_advance_width +#define FXFT_Get_Face_Ascender(face) ((FT_Face)face)->ascender +#define FXFT_Get_Face_Descender(face) ((FT_Face)face)->descender +#define FXFT_Get_Glyph_HoriAdvance(face) \ + ((FT_Face)face)->glyph->metrics.horiAdvance +#define FXFT_Get_MM_Axis(var, index) &static_cast(var)->axis[index] +#define FXFT_Get_MM_Axis_Min(axis) ((FT_Var_Axis*)axis)->minimum +#define FXFT_Get_MM_Axis_Max(axis) ((FT_Var_Axis*)axis)->maximum +#define FXFT_Get_MM_Axis_Def(axis) ((FT_Var_Axis*)axis)->def +#define FXFT_Alloc(library, size) \ + ((FT_Library)library)->memory->alloc(((FT_Library)library)->memory, size) +#define FXFT_Free(face, p) \ + ((FT_Face)face)->memory->free(((FT_Face)face)->memory, p) +#define FXFT_Get_Glyph_Outline(face) &static_cast(face)->glyph->outline +#define FXFT_Get_Outline_Bbox(outline, cbox) FT_Outline_Get_CBox(outline, cbox) +#define FXFT_Render_Glyph(face, mode) \ + FT_Render_Glyph(((FT_Face)face)->glyph, (enum FT_Render_Mode_)mode) +#define FXFT_Get_MM_Var(face, p) FT_Get_MM_Var((FT_Face)face, p) +#define FXFT_Set_MM_Design_Coordinates(face, n, p) \ + FT_Set_MM_Design_Coordinates((FT_Face)face, n, p) +#define FXFT_Set_Pixel_Sizes(face, w, h) FT_Set_Pixel_Sizes((FT_Face)face, w, h) +#define FXFT_Set_Transform(face, m, d) FT_Set_Transform((FT_Face)face, m, d) +#define FXFT_Outline_Embolden(outline, s) FT_Outline_Embolden(outline, s) +#define FXFT_Get_Glyph_Bitmap(face) &static_cast(face)->glyph->bitmap +#define FXFT_Get_Bitmap_Width(bitmap) ((FT_Bitmap*)bitmap)->width +#define FXFT_Get_Bitmap_Rows(bitmap) ((FT_Bitmap*)bitmap)->rows +#define FXFT_Get_Bitmap_PixelMode(bitmap) ((FT_Bitmap*)bitmap)->pixel_mode +#define FXFT_Get_Bitmap_Pitch(bitmap) ((FT_Bitmap*)bitmap)->pitch +#define FXFT_Get_Bitmap_Buffer(bitmap) ((FT_Bitmap*)bitmap)->buffer +#define FXFT_Get_Glyph_BitmapLeft(face) ((FT_Face)face)->glyph->bitmap_left +#define FXFT_Get_Glyph_BitmapTop(face) ((FT_Face)face)->glyph->bitmap_top +#define FXFT_Outline_Decompose(outline, funcs, params) \ + FT_Outline_Decompose(outline, funcs, params) +#define FXFT_Set_Char_Size(face, char_width, char_height, horz_resolution, \ + vert_resolution) \ + FT_Set_Char_Size(face, char_width, char_height, horz_resolution, \ + vert_resolution) +#define FXFT_Get_Glyph(slot, aglyph) FT_Get_Glyph(slot, aglyph) +#define FXFT_Glyph_Get_CBox(glyph, bbox_mode, acbox) \ + FT_Glyph_Get_CBox(glyph, bbox_mode, acbox) +#define FXFT_Done_Glyph(glyph) FT_Done_Glyph(glyph) +#define FXFT_Library_SetLcdFilter(library, filter) \ + FT_Library_SetLcdFilter((FT_Library)(library), filter) +int FXFT_unicode_from_adobe_name(const char* glyph_name); +void FXFT_adobe_name_from_unicode(char* name, wchar_t unicode); +#ifdef __cplusplus +}; +#endif + +#endif // CORE_FXGE_FX_FREETYPE_H_ diff --git a/core/fxge/ge/cfx_cliprgn.h b/core/fxge/ge/cfx_cliprgn.h index 5d6176091b..f3fd5856b6 100644 --- a/core/fxge/ge/cfx_cliprgn.h +++ b/core/fxge/ge/cfx_cliprgn.h @@ -7,7 +7,7 @@ #ifndef CORE_FXGE_GE_CFX_CLIPRGN_H_ #define CORE_FXGE_GE_CFX_CLIPRGN_H_ -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" class CFX_ClipRgn { public: diff --git a/core/fxge/ge/cfx_facecache.cpp b/core/fxge/ge/cfx_facecache.cpp index b78dd5b2ad..c297afb664 100644 --- a/core/fxge/ge/cfx_facecache.cpp +++ b/core/fxge/ge/cfx_facecache.cpp @@ -4,16 +4,16 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_facecache.h" +#include "core/fxge/cfx_facecache.h" #include +#include "core/fxge/cfx_fontmgr.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_substfont.h" +#include "core/fxge/fx_freetype.h" #include "core/fxge/ge/fx_text_int.h" -#include "core/fxge/include/cfx_fontmgr.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_substfont.h" -#include "core/fxge/include/fx_freetype.h" #include "third_party/base/numerics/safe_math.h" #ifdef _SKIA_SUPPORT_ diff --git a/core/fxge/ge/cfx_folderfontinfo.cpp b/core/fxge/ge/cfx_folderfontinfo.cpp index d4fe325576..31608bdf3a 100644 --- a/core/fxge/ge/cfx_folderfontinfo.cpp +++ b/core/fxge/ge/cfx_folderfontinfo.cpp @@ -6,8 +6,8 @@ #include "core/fxge/ge/cfx_folderfontinfo.h" -#include "core/fxge/include/cfx_fontmapper.h" -#include "core/fxge/include/fx_font.h" +#include "core/fxge/cfx_fontmapper.h" +#include "core/fxge/fx_font.h" #include "third_party/base/stl_util.h" diff --git a/core/fxge/ge/cfx_folderfontinfo.h b/core/fxge/ge/cfx_folderfontinfo.h index 2a8d05b3fd..ef4645cf53 100644 --- a/core/fxge/ge/cfx_folderfontinfo.h +++ b/core/fxge/ge/cfx_folderfontinfo.h @@ -10,9 +10,9 @@ #include #include -#include "core/fxge/include/cfx_fontmapper.h" -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/ifx_systemfontinfo.h" +#include "core/fxge/cfx_fontmapper.h" +#include "core/fxge/fx_font.h" +#include "core/fxge/ifx_systemfontinfo.h" class CFX_FolderFontInfo : public IFX_SystemFontInfo { public: diff --git a/core/fxge/ge/cfx_font.cpp b/core/fxge/ge/cfx_font.cpp index 461cf6f57b..737d7c450b 100644 --- a/core/fxge/ge/cfx_font.cpp +++ b/core/fxge/ge/cfx_font.cpp @@ -4,17 +4,17 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_font.h" #include "core/fpdfapi/fpdf_font/cpdf_font.h" +#include "core/fxge/cfx_facecache.h" +#include "core/fxge/cfx_fontcache.h" +#include "core/fxge/cfx_fontmgr.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_substfont.h" +#include "core/fxge/fx_freetype.h" #include "core/fxge/ge/fx_text_int.h" -#include "core/fxge/include/cfx_facecache.h" -#include "core/fxge/include/cfx_fontcache.h" -#include "core/fxge/include/cfx_fontmgr.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_substfont.h" -#include "core/fxge/include/fx_freetype.h" #define EM_ADJUST(em, a) (em == 0 ? (a) : (a)*1000 / em) diff --git a/core/fxge/ge/cfx_fontcache.cpp b/core/fxge/ge/cfx_fontcache.cpp index acae018c83..2a4d243719 100644 --- a/core/fxge/ge/cfx_fontcache.cpp +++ b/core/fxge/ge/cfx_fontcache.cpp @@ -4,11 +4,11 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_fontcache.h" +#include "core/fxge/cfx_fontcache.h" -#include "core/fxge/include/cfx_facecache.h" -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/cfx_facecache.h" +#include "core/fxge/fx_font.h" +#include "core/fxge/fx_freetype.h" CFX_FontCache::CountedFaceCache::CountedFaceCache() {} diff --git a/core/fxge/ge/cfx_fontmapper.cpp b/core/fxge/ge/cfx_fontmapper.cpp index f383730e8f..86dc2389d6 100644 --- a/core/fxge/ge/cfx_fontmapper.cpp +++ b/core/fxge/ge/cfx_fontmapper.cpp @@ -4,15 +4,15 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_fontmapper.h" +#include "core/fxge/cfx_fontmapper.h" #include #include #include -#include "core/fxge/include/cfx_substfont.h" -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/ifx_systemfontinfo.h" +#include "core/fxge/cfx_substfont.h" +#include "core/fxge/fx_font.h" +#include "core/fxge/ifx_systemfontinfo.h" #include "third_party/base/stl_util.h" diff --git a/core/fxge/ge/cfx_fontmgr.cpp b/core/fxge/ge/cfx_fontmgr.cpp index a3cc796a6d..54000e6b5d 100644 --- a/core/fxge/ge/cfx_fontmgr.cpp +++ b/core/fxge/ge/cfx_fontmgr.cpp @@ -4,14 +4,14 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_fontmgr.h" +#include "core/fxge/cfx_fontmgr.h" +#include "core/fxge/cfx_fontmapper.h" +#include "core/fxge/cfx_substfont.h" #include "core/fxge/fontdata/chromefontdata/chromefontdata.h" +#include "core/fxge/fx_font.h" #include "core/fxge/ge/cttfontdesc.h" -#include "core/fxge/include/cfx_fontmapper.h" -#include "core/fxge/include/cfx_substfont.h" -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/ifx_systemfontinfo.h" +#include "core/fxge/ifx_systemfontinfo.h" namespace { diff --git a/core/fxge/ge/cfx_gemodule.cpp b/core/fxge/ge/cfx_gemodule.cpp index 4eb4094304..ed6d6cb32e 100644 --- a/core/fxge/ge/cfx_gemodule.cpp +++ b/core/fxge/ge/cfx_gemodule.cpp @@ -4,12 +4,12 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_gemodule.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_fontcache.h" +#include "core/fxge/cfx_fontmgr.h" #include "core/fxge/ge/cfx_folderfontinfo.h" #include "core/fxge/ge/fx_text_int.h" -#include "core/fxge/include/cfx_fontcache.h" -#include "core/fxge/include/cfx_fontmgr.h" namespace { diff --git a/core/fxge/ge/cfx_graphstate.cpp b/core/fxge/ge/cfx_graphstate.cpp index de76987fa9..aaff154e65 100644 --- a/core/fxge/ge/cfx_graphstate.cpp +++ b/core/fxge/ge/cfx_graphstate.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_graphstate.h" +#include "core/fxge/cfx_graphstate.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" diff --git a/core/fxge/ge/cfx_graphstatedata.cpp b/core/fxge/ge/cfx_graphstatedata.cpp index c03f08624d..03798a6320 100644 --- a/core/fxge/ge/cfx_graphstatedata.cpp +++ b/core/fxge/ge/cfx_graphstatedata.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_graphstatedata.h" +#include "core/fxge/cfx_graphstatedata.h" #include "core/fxcrt/fx_memory.h" #include "core/fxcrt/fx_system.h" diff --git a/core/fxge/ge/cfx_pathdata.cpp b/core/fxge/ge/cfx_pathdata.cpp index 576e404fc3..73476bf271 100644 --- a/core/fxge/ge/cfx_pathdata.cpp +++ b/core/fxge/ge/cfx_pathdata.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_pathdata.h" +#include "core/fxge/cfx_pathdata.h" #include "core/fxcrt/fx_system.h" #include "third_party/base/numerics/safe_math.h" diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp index 4b479bae25..d11f2e1582 100644 --- a/core/fxge/ge/cfx_renderdevice.cpp +++ b/core/fxge/ge/cfx_renderdevice.cpp @@ -4,14 +4,14 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_renderdevice.h" #include "core/fxcrt/fx_safe_types.h" -#include "core/fxge/include/cfx_facecache.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/ifx_renderdevicedriver.h" +#include "core/fxge/cfx_facecache.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/ifx_renderdevicedriver.h" #if defined _SKIA_SUPPORT_ #include "third_party/skia/include/core/SkTypes.h" diff --git a/core/fxge/ge/cfx_substfont.cpp b/core/fxge/ge/cfx_substfont.cpp index 5014af74f2..475372e3d9 100644 --- a/core/fxge/ge/cfx_substfont.cpp +++ b/core/fxge/ge/cfx_substfont.cpp @@ -4,9 +4,9 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_substfont.h" +#include "core/fxge/cfx_substfont.h" -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_font.h" CFX_SubstFont::CFX_SubstFont() : m_Charset(FXFONT_ANSI_CHARSET), diff --git a/core/fxge/ge/cfx_unicodeencoding.cpp b/core/fxge/ge/cfx_unicodeencoding.cpp index 456c2f5d49..cba67ba354 100644 --- a/core/fxge/ge/cfx_unicodeencoding.cpp +++ b/core/fxge/ge/cfx_unicodeencoding.cpp @@ -4,10 +4,10 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_unicodeencoding.h" +#include "core/fxge/cfx_unicodeencoding.h" -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_font.h" +#include "core/fxge/fx_freetype.h" CFX_UnicodeEncoding::CFX_UnicodeEncoding(CFX_Font* pFont) : m_pFont(pFont) {} diff --git a/core/fxge/ge/cfx_unicodeencodingex.cpp b/core/fxge/ge/cfx_unicodeencodingex.cpp index 5ff5b03e50..5bacba42bd 100644 --- a/core/fxge/ge/cfx_unicodeencodingex.cpp +++ b/core/fxge/ge/cfx_unicodeencodingex.cpp @@ -4,11 +4,11 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_unicodeencodingex.h" +#include "core/fxge/cfx_unicodeencodingex.h" #include "core/fpdfapi/fpdf_font/cpdf_font.h" -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_font.h" +#include "core/fxge/fx_freetype.h" namespace { diff --git a/core/fxge/ge/cttfontdesc.cpp b/core/fxge/ge/cttfontdesc.cpp index 31018cb3da..1e4ece4dc1 100644 --- a/core/fxge/ge/cttfontdesc.cpp +++ b/core/fxge/ge/cttfontdesc.cpp @@ -6,7 +6,7 @@ #include "core/fxge/ge/cttfontdesc.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_freetype.h" CTTFontDesc::~CTTFontDesc() { if (m_Type == 1) { diff --git a/core/fxge/ge/cttfontdesc.h b/core/fxge/ge/cttfontdesc.h index 329b9e6bc0..8fc2a34e71 100644 --- a/core/fxge/ge/cttfontdesc.h +++ b/core/fxge/ge/cttfontdesc.h @@ -8,7 +8,7 @@ #define CORE_FXGE_GE_CTTFONTDESC_H_ #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_font.h" #define FX_FONT_FLAG_SERIF 0x01 #define FX_FONT_FLAG_FIXEDPITCH 0x02 diff --git a/core/fxge/ge/fx_ge_fontmap.cpp b/core/fxge/ge/fx_ge_fontmap.cpp index 2f5410517d..eed5d929b9 100644 --- a/core/fxge/ge/fx_ge_fontmap.cpp +++ b/core/fxge/ge/fx_ge_fontmap.cpp @@ -4,8 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/cfx_fontmapper.h" -#include "core/fxge/include/ifx_systemfontinfo.h" +#include "core/fxge/cfx_fontmapper.h" +#include "core/fxge/ifx_systemfontinfo.h" static CFX_ByteString GetStringFromTable(const uint8_t* string_ptr, uint32_t string_ptr_length, diff --git a/core/fxge/ge/fx_ge_linux.cpp b/core/fxge/ge/fx_ge_linux.cpp index b13a133bc1..47cee34766 100644 --- a/core/fxge/ge/fx_ge_linux.cpp +++ b/core/fxge/ge/fx_ge_linux.cpp @@ -10,10 +10,10 @@ #include +#include "core/fxge/cfx_gemodule.h" #include "core/fxge/ge/cfx_folderfontinfo.h" #include "core/fxge/ge/fx_text_int.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/ifx_systemfontinfo.h" +#include "core/fxge/ifx_systemfontinfo.h" #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ namespace { diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp index 747fd83178..ca88879d10 100644 --- a/core/fxge/ge/fx_ge_text.cpp +++ b/core/fxge/ge/fx_ge_text.cpp @@ -10,10 +10,10 @@ #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_safe_types.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/fx_freetype.h" #include "core/fxge/ge/fx_text_int.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/fx_freetype.h" -#include "core/fxge/include/ifx_renderdevicedriver.h" +#include "core/fxge/ifx_renderdevicedriver.h" namespace { diff --git a/core/fxge/ge/fx_text_int.h b/core/fxge/ge/fx_text_int.h index 87a9b3eced..4de6587d41 100644 --- a/core/fxge/ge/fx_text_int.h +++ b/core/fxge/ge/fx_text_int.h @@ -9,8 +9,8 @@ #include -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/fx_freetype.h" +#include "core/fxge/fx_font.h" +#include "core/fxge/fx_freetype.h" struct _CFX_UniqueKeyGen { void Generate(int count, ...); diff --git a/core/fxge/ifx_renderdevicedriver.cpp b/core/fxge/ifx_renderdevicedriver.cpp index 0c1f922800..6ae1432a11 100644 --- a/core/fxge/ifx_renderdevicedriver.cpp +++ b/core/fxge/ifx_renderdevicedriver.cpp @@ -4,11 +4,11 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/include/ifx_renderdevicedriver.h" +#include "core/fxge/ifx_renderdevicedriver.h" #include "core/fxcrt/fx_coordinates.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" IFX_RenderDeviceDriver::~IFX_RenderDeviceDriver() {} diff --git a/core/fxge/ifx_renderdevicedriver.h b/core/fxge/ifx_renderdevicedriver.h new file mode 100644 index 0000000000..84e3ebc97b --- /dev/null +++ b/core/fxge/ifx_renderdevicedriver.h @@ -0,0 +1,108 @@ +// 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_FXGE_IFX_RENDERDEVICEDRIVER_H_ +#define CORE_FXGE_IFX_RENDERDEVICEDRIVER_H_ + +#include "core/fxcrt/fx_system.h" + +class CFX_DIBitmap; +class CFX_DIBSource; +class CFX_Font; +class CFX_GraphStateData; +class CFX_Matrix; +class CFX_PathData; +class CPDF_ShadingPattern; +class IFX_Pause; +struct FXTEXT_CHARPOS; +struct FX_RECT; + +class IFX_RenderDeviceDriver { + public: + virtual ~IFX_RenderDeviceDriver(); + + virtual int GetDeviceCaps(int caps_id) const = 0; + virtual CFX_Matrix GetCTM() const; + + virtual FX_BOOL StartRendering(); + virtual void EndRendering(); + virtual void SaveState() = 0; + virtual void RestoreState(bool bKeepSaved) = 0; + + virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, + const CFX_Matrix* pObject2Device, + int fill_mode) = 0; + virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, + const CFX_Matrix* pObject2Device, + const CFX_GraphStateData* pGraphState); + virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, + const CFX_Matrix* pObject2Device, + const CFX_GraphStateData* pGraphState, + uint32_t fill_color, + uint32_t stroke_color, + int fill_mode, + int blend_type) = 0; + virtual FX_BOOL SetPixel(int x, int y, uint32_t color); + virtual FX_BOOL FillRectWithBlend(const FX_RECT* pRect, + uint32_t fill_color, + int blend_type); + virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, + FX_FLOAT y1, + FX_FLOAT x2, + FX_FLOAT y2, + uint32_t color, + int blend_type); + + virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; + virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top); + virtual CFX_DIBitmap* GetBackDrop(); + virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, + uint32_t color, + const FX_RECT* pSrcRect, + int dest_left, + int dest_top, + int blend_type) = 0; + virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, + uint32_t color, + int dest_left, + int dest_top, + int dest_width, + int dest_height, + const FX_RECT* pClipRect, + uint32_t flags, + int blend_type) = 0; + virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, + int bitmap_alpha, + uint32_t color, + const CFX_Matrix* pMatrix, + uint32_t flags, + void*& handle, + int blend_type) = 0; + virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); + virtual void CancelDIBits(void* handle); + virtual FX_BOOL DrawDeviceText(int nChars, + const FXTEXT_CHARPOS* pCharPos, + CFX_Font* pFont, + const CFX_Matrix* pObject2Device, + FX_FLOAT font_size, + uint32_t color); + virtual void* GetPlatformSurface() const; + virtual int GetDriverType() const; + virtual void ClearDriver(); + virtual FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, + const CFX_Matrix* pMatrix, + const FX_RECT& clip_rect, + int alpha, + FX_BOOL bAlphaMode); + virtual bool SetBitsWithMask(const CFX_DIBSource* pBitmap, + const CFX_DIBSource* pMask, + int left, + int top, + int bitmap_alpha, + int blend_type); +}; + +#endif // CORE_FXGE_IFX_RENDERDEVICEDRIVER_H_ diff --git a/core/fxge/ifx_systemfontinfo.h b/core/fxge/ifx_systemfontinfo.h new file mode 100644 index 0000000000..5eb3147c54 --- /dev/null +++ b/core/fxge/ifx_systemfontinfo.h @@ -0,0 +1,49 @@ +// 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_FXGE_IFX_SYSTEMFONTINFO_H_ +#define CORE_FXGE_IFX_SYSTEMFONTINFO_H_ + +#include "core/fxge/cfx_fontmapper.h" +#include "core/fxge/fx_font.h" + +const uint32_t kTableNAME = FXDWORD_GET_MSBFIRST("name"); +const uint32_t kTableTTCF = FXDWORD_GET_MSBFIRST("ttcf"); + +class IFX_SystemFontInfo { + public: + static std::unique_ptr CreateDefault( + const char** pUserPaths); + + virtual ~IFX_SystemFontInfo() {} + + virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0; + virtual void* MapFont(int weight, + FX_BOOL bItalic, + int charset, + int pitch_family, + const FX_CHAR* face, + int& iExact) = 0; + +#ifdef PDF_ENABLE_XFA + virtual void* MapFontByUnicode(uint32_t dwUnicode, + int weight, + FX_BOOL bItalic, + int pitch_family); +#endif // PDF_ENABLE_XFA + + virtual void* GetFont(const FX_CHAR* face) = 0; + virtual uint32_t GetFontData(void* hFont, + uint32_t table, + uint8_t* buffer, + uint32_t size) = 0; + virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) = 0; + virtual FX_BOOL GetFontCharset(void* hFont, int& charset) = 0; + virtual int GetFaceIndex(void* hFont); + virtual void DeleteFont(void* hFont) = 0; +}; + +#endif // CORE_FXGE_IFX_SYSTEMFONTINFO_H_ diff --git a/core/fxge/include/cfx_facecache.h b/core/fxge/include/cfx_facecache.h deleted file mode 100644 index fc1b28b523..0000000000 --- a/core/fxge/include/cfx_facecache.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_FXGE_INCLUDE_CFX_FACECACHE_H_ -#define CORE_FXGE_INCLUDE_CFX_FACECACHE_H_ - -#include - -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/fx_freetype.h" - -class CFX_FaceCache { - public: - explicit CFX_FaceCache(FXFT_Face face); - ~CFX_FaceCache(); - const CFX_GlyphBitmap* LoadGlyphBitmap(const CFX_Font* pFont, - uint32_t glyph_index, - FX_BOOL bFontStyle, - const CFX_Matrix* pMatrix, - int dest_width, - int anti_alias, - int& text_flags); - const CFX_PathData* LoadGlyphPath(const CFX_Font* pFont, - uint32_t glyph_index, - int dest_width); - -#ifdef _SKIA_SUPPORT_ - CFX_TypeFace* GetDeviceCache(const CFX_Font* pFont); -#endif - - private: - CFX_GlyphBitmap* RenderGlyph(const CFX_Font* pFont, - uint32_t glyph_index, - FX_BOOL bFontStyle, - const CFX_Matrix* pMatrix, - int dest_width, - int anti_alias); - CFX_GlyphBitmap* RenderGlyph_Nativetext(const CFX_Font* pFont, - uint32_t glyph_index, - const CFX_Matrix* pMatrix, - int dest_width, - int anti_alias); - CFX_GlyphBitmap* LookUpGlyphBitmap(const CFX_Font* pFont, - const CFX_Matrix* pMatrix, - const CFX_ByteString& FaceGlyphsKey, - uint32_t glyph_index, - FX_BOOL bFontStyle, - int dest_width, - int anti_alias); - void InitPlatform(); - void DestroyPlatform(); - - FXFT_Face const m_Face; - std::map> m_SizeMap; - std::map> m_PathMap; -#ifdef _SKIA_SUPPORT_ - CFX_TypeFace* m_pTypeface; -#endif -}; - -#endif // CORE_FXGE_INCLUDE_CFX_FACECACHE_H_ diff --git a/core/fxge/include/cfx_fontcache.h b/core/fxge/include/cfx_fontcache.h deleted file mode 100644 index 7fe0de47f1..0000000000 --- a/core/fxge/include/cfx_fontcache.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_FXGE_INCLUDE_CFX_FONTCACHE_H_ -#define CORE_FXGE_INCLUDE_CFX_FONTCACHE_H_ - -#include -#include - -#include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/fx_freetype.h" - -class CFX_FaceCache; - -class CFX_FontCache { - public: - CFX_FontCache(); - ~CFX_FontCache(); - CFX_FaceCache* GetCachedFace(const CFX_Font* pFont); - void ReleaseCachedFace(const CFX_Font* pFont); -#ifdef _SKIA_SUPPORT_ - CFX_TypeFace* GetDeviceCache(const CFX_Font* pFont); -#endif - - private: - struct CountedFaceCache { - CountedFaceCache(); - ~CountedFaceCache(); - std::unique_ptr m_Obj; - uint32_t m_nCount; - }; - - using CFX_FTCacheMap = std::map>; - CFX_FTCacheMap m_FTFaceMap; - CFX_FTCacheMap m_ExtFaceMap; -}; - -#endif // CORE_FXGE_INCLUDE_CFX_FONTCACHE_H_ diff --git a/core/fxge/include/cfx_fontmapper.h b/core/fxge/include/cfx_fontmapper.h deleted file mode 100644 index 0d82855c41..0000000000 --- a/core/fxge/include/cfx_fontmapper.h +++ /dev/null @@ -1,84 +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_FXGE_INCLUDE_CFX_FONTMAPPER_H_ -#define CORE_FXGE_INCLUDE_CFX_FONTMAPPER_H_ - -#include -#include - -#include "core/fxge/include/cfx_fontmgr.h" -#include "core/fxge/include/fx_font.h" - -class CFX_SubstFont; - -class CFX_FontMapper { - public: - explicit CFX_FontMapper(CFX_FontMgr* mgr); - ~CFX_FontMapper(); - - void SetSystemFontInfo(std::unique_ptr pFontInfo); - IFX_SystemFontInfo* GetSystemFontInfo() { return m_pFontInfo.get(); } - void AddInstalledFont(const CFX_ByteString& name, int charset); - void LoadInstalledFonts(); - - FXFT_Face FindSubstFont(const CFX_ByteString& face_name, - FX_BOOL bTrueType, - uint32_t flags, - int weight, - int italic_angle, - int CharsetCP, - CFX_SubstFont* pSubstFont); -#ifdef PDF_ENABLE_XFA - FXFT_Face FindSubstFontByUnicode(uint32_t dwUnicode, - uint32_t flags, - int weight, - int italic_angle); -#endif // PDF_ENABLE_XFA - FX_BOOL IsBuiltinFace(const FXFT_Face face) const; - int GetFaceSize() const; - CFX_ByteString GetFaceName(int index) const { - return m_FaceArray[index].name; - } - - std::vector m_InstalledTTFonts; - - private: - static const size_t MM_FACE_COUNT = 2; - static const size_t FOXIT_FACE_COUNT = 14; - - CFX_ByteString GetPSNameFromTT(void* hFont); - CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name); - FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont, - int iBaseFont, - int italic_angle, - int weight, - int picthfamily); - FXFT_Face GetCachedTTCFace(void* hFont, - const uint32_t tableTTCF, - uint32_t ttc_size, - uint32_t font_size); - FXFT_Face GetCachedFace(void* hFont, - CFX_ByteString SubstName, - int weight, - FX_BOOL bItalic, - uint32_t font_size); - - struct FaceData { - CFX_ByteString name; - uint32_t charset; - }; - - FX_BOOL m_bListLoaded; - FXFT_Face m_MMFaces[MM_FACE_COUNT]; - CFX_ByteString m_LastFamily; - std::vector m_FaceArray; - std::unique_ptr m_pFontInfo; - FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT]; - CFX_FontMgr* const m_pFontMgr; -}; - -#endif // CORE_FXGE_INCLUDE_CFX_FONTMAPPER_H_ diff --git a/core/fxge/include/cfx_fontmgr.h b/core/fxge/include/cfx_fontmgr.h deleted file mode 100644 index c8e66aee14..0000000000 --- a/core/fxge/include/cfx_fontmgr.h +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef CORE_FXGE_INCLUDE_CFX_FONTMGR_H_ -#define CORE_FXGE_INCLUDE_CFX_FONTMGR_H_ - -#include -#include - -#include "core/fxge/include/fx_font.h" - -class IFX_SystemFontInfo; -class CFX_FontMapper; -class CFX_SubstFont; -class CTTFontDesc; - -class CFX_FontMgr { - public: - CFX_FontMgr(); - ~CFX_FontMgr(); - - void InitFTLibrary(); - - FXFT_Face GetCachedFace(const CFX_ByteString& face_name, - int weight, - FX_BOOL bItalic, - uint8_t*& pFontData); - FXFT_Face AddCachedFace(const CFX_ByteString& face_name, - int weight, - FX_BOOL bItalic, - uint8_t* pData, - uint32_t size, - int face_index); - FXFT_Face GetCachedTTCFace(int ttc_size, - uint32_t checksum, - int font_offset, - uint8_t*& pFontData); - FXFT_Face AddCachedTTCFace(int ttc_size, - uint32_t checksum, - uint8_t* pData, - uint32_t size, - int font_offset); - FXFT_Face GetFileFace(const FX_CHAR* filename, int face_index); - FXFT_Face GetFixedFace(const uint8_t* pData, uint32_t size, int face_index); - void ReleaseFace(FXFT_Face face); - void SetSystemFontInfo(std::unique_ptr pFontInfo); - FXFT_Face FindSubstFont(const CFX_ByteString& face_name, - FX_BOOL bTrueType, - uint32_t flags, - int weight, - int italic_angle, - int CharsetCP, - CFX_SubstFont* pSubstFont); - bool GetBuiltinFont(size_t index, const uint8_t** pFontData, uint32_t* size); - CFX_FontMapper* GetBuiltinMapper() const { return m_pBuiltinMapper.get(); } - FXFT_Library GetFTLibrary() const { return m_FTLibrary; } - bool FTLibrarySupportsHinting() const { return m_FTLibrarySupportsHinting; } - - private: - std::unique_ptr m_pBuiltinMapper; - std::map m_FaceMap; - FXFT_Library m_FTLibrary; - bool m_FTLibrarySupportsHinting; -}; - -#endif // CORE_FXGE_INCLUDE_CFX_FONTMGR_H_ diff --git a/core/fxge/include/cfx_fxgedevice.h b/core/fxge/include/cfx_fxgedevice.h deleted file mode 100644 index 7f34f1ca4a..0000000000 --- a/core/fxge/include/cfx_fxgedevice.h +++ /dev/null @@ -1,46 +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_FXGE_INCLUDE_CFX_FXGEDEVICE_H_ -#define CORE_FXGE_INCLUDE_CFX_FXGEDEVICE_H_ - -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/fx_dib.h" - -class SkPictureRecorder; - -class CFX_FxgeDevice : public CFX_RenderDevice { - public: - CFX_FxgeDevice(); - ~CFX_FxgeDevice() override; - - bool Attach(CFX_DIBitmap* pBitmap, - bool bRgbByteOrder, - CFX_DIBitmap* pOriDevice, - bool bGroupKnockout); - bool Create(int width, - int height, - FXDIB_Format format, - CFX_DIBitmap* pOriDevice); - -#ifdef _SKIA_SUPPORT_ - bool AttachRecorder(SkPictureRecorder* recorder); - void Clear(uint32_t color); - SkPictureRecorder* CreateRecorder(int size_x, int size_y); - void DebugVerifyBitmapIsPreMultiplied() const override; - bool SetBitsWithMask(const CFX_DIBSource* pBitmap, - const CFX_DIBSource* pMask, - int left, - int top, - int bitmap_alpha, - int blend_type) override; -#endif - - private: - bool m_bOwnedBitmap; -}; - -#endif // CORE_FXGE_INCLUDE_CFX_FXGEDEVICE_H_ diff --git a/core/fxge/include/cfx_gemodule.h b/core/fxge/include/cfx_gemodule.h deleted file mode 100644 index 351c036b52..0000000000 --- a/core/fxge/include/cfx_gemodule.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef CORE_FXGE_INCLUDE_CFX_GEMODULE_H_ -#define CORE_FXGE_INCLUDE_CFX_GEMODULE_H_ - -#include - -#include "core/fxge/include/cfx_fontmgr.h" -#include "core/fxge/include/fx_font.h" - -class CCodec_ModuleMgr; -class CFX_FontCache; -class CFX_FontMgr; - -class CFX_GEModule { - public: - static CFX_GEModule* Get(); - static void Destroy(); - - void Init(const char** pUserFontPaths, CCodec_ModuleMgr* pCodecModule); - CFX_FontCache* GetFontCache(); - CFX_FontMgr* GetFontMgr() { return m_pFontMgr.get(); } - void SetTextGamma(FX_FLOAT gammaValue); - const uint8_t* GetTextGammaTable() const; - - CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; } - void* GetPlatformData() { return m_pPlatformData; } - - FXFT_Library m_FTLibrary; - - private: - CFX_GEModule(); - ~CFX_GEModule(); - - void InitPlatform(); - void DestroyPlatform(); - - uint8_t m_GammaValue[256]; - CFX_FontCache* m_pFontCache; - std::unique_ptr m_pFontMgr; - CCodec_ModuleMgr* m_pCodecModule; - void* m_pPlatformData; - const char** m_pUserFontPaths; -}; - -#endif // CORE_FXGE_INCLUDE_CFX_GEMODULE_H_ diff --git a/core/fxge/include/cfx_graphstate.h b/core/fxge/include/cfx_graphstate.h deleted file mode 100644 index 1faec0db7e..0000000000 --- a/core/fxge/include/cfx_graphstate.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef CORE_FXGE_INCLUDE_CFX_GRAPHSTATE_H_ -#define CORE_FXGE_INCLUDE_CFX_GRAPHSTATE_H_ - -#include "core/fxcrt/cfx_count_ref.h" -#include "core/fxge/include/cfx_graphstatedata.h" - -class CPDF_Array; - -class CFX_GraphState { - public: - CFX_GraphState(); - CFX_GraphState(const CFX_GraphState& that); - ~CFX_GraphState(); - - void Emplace(); - - void SetLineDash(CPDF_Array* pArray, FX_FLOAT phase, FX_FLOAT scale); - - FX_FLOAT GetLineWidth() const; - void SetLineWidth(FX_FLOAT width); - - CFX_GraphStateData::LineCap GetLineCap() const; - void SetLineCap(CFX_GraphStateData::LineCap cap); - - CFX_GraphStateData::LineJoin GetLineJoin() const; - void SetLineJoin(CFX_GraphStateData::LineJoin join); - - FX_FLOAT GetMiterLimit() const; - void SetMiterLimit(FX_FLOAT limit); - - // FIXME(tsepez): remove when all GraphStateData usage gone. - const CFX_GraphStateData* GetObject() const { return m_Ref.GetObject(); } - - private: - CFX_CountRef m_Ref; -}; - -#endif // CORE_FXGE_INCLUDE_CFX_GRAPHSTATE_H_ diff --git a/core/fxge/include/cfx_graphstatedata.h b/core/fxge/include/cfx_graphstatedata.h deleted file mode 100644 index b5f784702d..0000000000 --- a/core/fxge/include/cfx_graphstatedata.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_FXGE_INCLUDE_CFX_GRAPHSTATEDATA_H_ -#define CORE_FXGE_INCLUDE_CFX_GRAPHSTATEDATA_H_ - -#include "core/fxcrt/fx_system.h" - -class CFX_GraphStateData { - public: - enum LineCap { LineCapButt = 0, LineCapRound = 1, LineCapSquare = 2 }; - - CFX_GraphStateData(); - CFX_GraphStateData(const CFX_GraphStateData& src); - ~CFX_GraphStateData(); - - void Copy(const CFX_GraphStateData& src); - void SetDashCount(int count); - - LineCap m_LineCap; - int m_DashCount; - FX_FLOAT* m_DashArray; - FX_FLOAT m_DashPhase; - - enum LineJoin { - LineJoinMiter = 0, - LineJoinRound = 1, - LineJoinBevel = 2, - }; - LineJoin m_LineJoin; - FX_FLOAT m_MiterLimit; - FX_FLOAT m_LineWidth; -}; - -#endif // CORE_FXGE_INCLUDE_CFX_GRAPHSTATEDATA_H_ diff --git a/core/fxge/include/cfx_pathdata.h b/core/fxge/include/cfx_pathdata.h deleted file mode 100644 index 56682dd651..0000000000 --- a/core/fxge/include/cfx_pathdata.h +++ /dev/null @@ -1,56 +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_FXGE_INCLUDE_CFX_PATHDATA_H_ -#define CORE_FXGE_INCLUDE_CFX_PATHDATA_H_ - -#include "core/fxcrt/fx_coordinates.h" -#include "core/fxcrt/fx_system.h" -#include "core/fxge/include/cfx_renderdevice.h" - -struct FX_PATHPOINT { - FX_FLOAT m_PointX; - FX_FLOAT m_PointY; - int m_Flag; -}; - -class CFX_PathData { - public: - CFX_PathData(); - CFX_PathData(const CFX_PathData& src); - ~CFX_PathData(); - - int GetPointCount() const { return m_PointCount; } - int GetFlag(int index) const { return m_pPoints[index].m_Flag; } - FX_FLOAT GetPointX(int index) const { return m_pPoints[index].m_PointX; } - FX_FLOAT GetPointY(int index) const { return m_pPoints[index].m_PointY; } - FX_PATHPOINT* GetPoints() const { return m_pPoints; } - - void SetPointCount(int nPoints); - void AllocPointCount(int nPoints); - void AddPointCount(int addPoints); - CFX_FloatRect GetBoundingBox() const; - CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const; - void Transform(const CFX_Matrix* pMatrix); - FX_BOOL IsRect() const; - FX_BOOL GetZeroAreaPath(CFX_PathData& NewPath, - CFX_Matrix* pMatrix, - FX_BOOL& bThin, - FX_BOOL bAdjust) const; - FX_BOOL IsRect(const CFX_Matrix* pMatrix, CFX_FloatRect* rect) const; - void Append(const CFX_PathData* pSrc, const CFX_Matrix* pMatrix); - void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top); - void SetPoint(int index, FX_FLOAT x, FX_FLOAT y, int flag); - void TrimPoints(int nPoints); - void Copy(const CFX_PathData& src); - - private: - int m_PointCount; - int m_AllocCount; - FX_PATHPOINT* m_pPoints; -}; - -#endif // CORE_FXGE_INCLUDE_CFX_PATHDATA_H_ diff --git a/core/fxge/include/cfx_renderdevice.h b/core/fxge/include/cfx_renderdevice.h deleted file mode 100644 index f790cdae68..0000000000 --- a/core/fxge/include/cfx_renderdevice.h +++ /dev/null @@ -1,258 +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_FXGE_INCLUDE_CFX_RENDERDEVICE_H_ -#define CORE_FXGE_INCLUDE_CFX_RENDERDEVICE_H_ - -#include - -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/fx_dib.h" -#include "core/fxge/include/fx_font.h" - -class CFX_Font; -class CFX_GraphStateData; -class IFX_RenderDeviceDriver; - -#define FXDC_DEVICE_CLASS 1 -#define FXDC_PIXEL_WIDTH 2 -#define FXDC_PIXEL_HEIGHT 3 -#define FXDC_BITS_PIXEL 4 -#define FXDC_HORZ_SIZE 5 -#define FXDC_VERT_SIZE 6 -#define FXDC_RENDER_CAPS 7 -#define FXDC_DISPLAY 1 -#define FXDC_PRINTER 2 - -#define FXPT_CLOSEFIGURE 0x01 -#define FXPT_LINETO 0x02 -#define FXPT_BEZIERTO 0x04 -#define FXPT_MOVETO 0x06 -#define FXPT_TYPE 0x06 - -#define FXRC_GET_BITS 0x01 -#define FXRC_BIT_MASK 0x02 -#define FXRC_ALPHA_MASK 0x04 -#define FXRC_ALPHA_PATH 0x10 -#define FXRC_ALPHA_IMAGE 0x20 -#define FXRC_ALPHA_OUTPUT 0x40 -#define FXRC_BLEND_MODE 0x80 -#define FXRC_SOFT_CLIP 0x100 -#define FXRC_CMYK_OUTPUT 0x200 -#define FXRC_BITMASK_OUTPUT 0x400 -#define FXRC_BYTEMASK_OUTPUT 0x800 -#define FXRENDER_IMAGE_LOSSY 0x1000 -#define FXRC_FILLSTROKE_PATH 0x2000 -#define FXRC_SHADING 0x4000 - -#define FXFILL_ALTERNATE 1 -#define FXFILL_WINDING 2 -#define FXFILL_FULLCOVER 4 -#define FXFILL_RECT_AA 8 -#define FX_FILL_STROKE 16 -#define FX_STROKE_ADJUST 32 -#define FX_STROKE_TEXT_MODE 64 -#define FX_FILL_TEXT_MODE 128 -#define FX_ZEROAREA_FILL 256 -#define FXFILL_NOPATHSMOOTH 512 - -#define FXTEXT_CLEARTYPE 0x01 -#define FXTEXT_BGR_STRIPE 0x02 -#define FXTEXT_PRINTGRAPHICTEXT 0x04 -#define FXTEXT_NO_NATIVETEXT 0x08 -#define FXTEXT_PRINTIMAGETEXT 0x10 -#define FXTEXT_NOSMOOTH 0x20 - -struct FXTEXT_CHARPOS { - FX_FLOAT m_AdjustMatrix[4]; - FX_FLOAT m_OriginX; - FX_FLOAT m_OriginY; - uint32_t m_GlyphIndex; - int32_t m_FontCharWidth; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - uint32_t m_ExtGID; -#endif - int32_t m_FallbackFontPosition; - bool m_bGlyphAdjust; - bool m_bFontStyle; -}; - -class CFX_RenderDevice { - public: - CFX_RenderDevice(); - virtual ~CFX_RenderDevice(); - - // Take ownership of |pDriver|. - void SetDeviceDriver(std::unique_ptr pDriver); - IFX_RenderDeviceDriver* GetDeviceDriver() const { - return m_pDeviceDriver.get(); - } - - void SaveState(); - void RestoreState(bool bKeepSaved); - - int GetWidth() const { return m_Width; } - int GetHeight() const { return m_Height; } - int GetDeviceClass() const { return m_DeviceClass; } - int GetRenderCaps() const { return m_RenderCaps; } - int GetDeviceCaps(int id) const; - CFX_Matrix GetCTM() const; - CFX_DIBitmap* GetBitmap() const { return m_pBitmap; } - void SetBitmap(CFX_DIBitmap* pBitmap) { m_pBitmap = pBitmap; } - FX_BOOL CreateCompatibleBitmap(CFX_DIBitmap* pDIB, - int width, - int height) const; - const FX_RECT& GetClipBox() const { return m_ClipBox; } - FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, - const CFX_Matrix* pObject2Device, - int fill_mode); - FX_BOOL SetClip_Rect(const FX_RECT& pRect); - FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, - const CFX_Matrix* pObject2Device, - const CFX_GraphStateData* pGraphState); - FX_BOOL DrawPath(const CFX_PathData* pPathData, - const CFX_Matrix* pObject2Device, - const CFX_GraphStateData* pGraphState, - uint32_t fill_color, - uint32_t stroke_color, - int fill_mode) { - return DrawPathWithBlend(pPathData, pObject2Device, pGraphState, fill_color, - stroke_color, fill_mode, FXDIB_BLEND_NORMAL); - } - FX_BOOL DrawPathWithBlend(const CFX_PathData* pPathData, - const CFX_Matrix* pObject2Device, - const CFX_GraphStateData* pGraphState, - uint32_t fill_color, - uint32_t stroke_color, - int fill_mode, - int blend_type); - FX_BOOL SetPixel(int x, int y, uint32_t color); - FX_BOOL FillRect(const FX_RECT* pRect, uint32_t color) { - return FillRectWithBlend(pRect, color, FXDIB_BLEND_NORMAL); - } - FX_BOOL FillRectWithBlend(const FX_RECT* pRect, - uint32_t color, - int blend_type); - FX_BOOL DrawCosmeticLine(FX_FLOAT x1, - FX_FLOAT y1, - FX_FLOAT x2, - FX_FLOAT y2, - uint32_t color, - int fill_mode, - int blend_type); - - FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top); - CFX_DIBitmap* GetBackDrop(); - FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, int left, int top) { - return SetDIBitsWithBlend(pBitmap, left, top, FXDIB_BLEND_NORMAL); - } - FX_BOOL SetDIBitsWithBlend(const CFX_DIBSource* pBitmap, - int left, - int top, - int blend_type); - FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, - int left, - int top, - int dest_width, - int dest_height) { - return StretchDIBitsWithFlagsAndBlend(pBitmap, left, top, dest_width, - dest_height, 0, FXDIB_BLEND_NORMAL); - } - FX_BOOL StretchDIBitsWithFlagsAndBlend(const CFX_DIBSource* pBitmap, - int left, - int top, - int dest_width, - int dest_height, - uint32_t flags, - int blend_type); - FX_BOOL SetBitMask(const CFX_DIBSource* pBitmap, - int left, - int top, - uint32_t color); - FX_BOOL StretchBitMask(const CFX_DIBSource* pBitmap, - int left, - int top, - int dest_width, - int dest_height, - uint32_t color); - FX_BOOL StretchBitMaskWithFlags(const CFX_DIBSource* pBitmap, - int left, - int top, - int dest_width, - int dest_height, - uint32_t color, - uint32_t flags); - FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, - int bitmap_alpha, - uint32_t color, - const CFX_Matrix* pMatrix, - uint32_t flags, - void*& handle) { - return StartDIBitsWithBlend(pBitmap, bitmap_alpha, color, pMatrix, flags, - handle, FXDIB_BLEND_NORMAL); - } - FX_BOOL StartDIBitsWithBlend(const CFX_DIBSource* pBitmap, - int bitmap_alpha, - uint32_t color, - const CFX_Matrix* pMatrix, - uint32_t flags, - void*& handle, - int blend_type); - FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); - void CancelDIBits(void* handle); - - FX_BOOL DrawNormalText(int nChars, - const FXTEXT_CHARPOS* pCharPos, - CFX_Font* pFont, - FX_FLOAT font_size, - const CFX_Matrix* pText2Device, - uint32_t fill_color, - uint32_t text_flags); - FX_BOOL DrawTextPath(int nChars, - const FXTEXT_CHARPOS* pCharPos, - CFX_Font* pFont, - FX_FLOAT font_size, - const CFX_Matrix* pText2User, - const CFX_Matrix* pUser2Device, - const CFX_GraphStateData* pGraphState, - uint32_t fill_color, - uint32_t stroke_color, - CFX_PathData* pClippingPath, - int nFlag); - -#ifdef _SKIA_SUPPORT_ - virtual void DebugVerifyBitmapIsPreMultiplied() const; - virtual bool SetBitsWithMask(const CFX_DIBSource* pBitmap, - const CFX_DIBSource* pMask, - int left, - int top, - int bitmap_alpha, - int blend_type); - void Flush(); -#endif - - private: - void InitDeviceInfo(); - void UpdateClipBox(); - FX_BOOL DrawFillStrokePath(const CFX_PathData* pPathData, - const CFX_Matrix* pObject2Device, - const CFX_GraphStateData* pGraphState, - uint32_t fill_color, - uint32_t stroke_color, - int fill_mode, - int blend_type); - - CFX_DIBitmap* m_pBitmap; - int m_Width; - int m_Height; - int m_bpp; - int m_RenderCaps; - int m_DeviceClass; - FX_RECT m_ClipBox; - std::unique_ptr m_pDeviceDriver; -}; - -#endif // CORE_FXGE_INCLUDE_CFX_RENDERDEVICE_H_ diff --git a/core/fxge/include/cfx_substfont.h b/core/fxge/include/cfx_substfont.h deleted file mode 100644 index 8cce389fb3..0000000000 --- a/core/fxge/include/cfx_substfont.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_FXGE_INCLUDE_CFX_SUBSTFONT_H_ -#define CORE_FXGE_INCLUDE_CFX_SUBSTFONT_H_ - -#include "core/fxcrt/fx_string.h" - -#define FXFONT_SUBST_MM 0x01 -#define FXFONT_SUBST_GLYPHPATH 0x04 -#define FXFONT_SUBST_CLEARTYPE 0x08 -#define FXFONT_SUBST_TRANSFORM 0x10 -#define FXFONT_SUBST_NONSYMBOL 0x20 -#define FXFONT_SUBST_EXACT 0x40 -#define FXFONT_SUBST_STANDARD 0x80 - -class CFX_SubstFont { - public: - CFX_SubstFont(); - - CFX_ByteString m_Family; - int m_Charset; - uint32_t m_SubstFlags; - int m_Weight; - int m_ItalicAngle; - bool m_bSubstCJK; - int m_WeightCJK; - bool m_bItalicCJK; -}; - -#endif // CORE_FXGE_INCLUDE_CFX_SUBSTFONT_H_ diff --git a/core/fxge/include/cfx_unicodeencoding.h b/core/fxge/include/cfx_unicodeencoding.h deleted file mode 100644 index dee785f9df..0000000000 --- a/core/fxge/include/cfx_unicodeencoding.h +++ /dev/null @@ -1,46 +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_FXGE_INCLUDE_CFX_UNICODEENCODING_H_ -#define CORE_FXGE_INCLUDE_CFX_UNICODEENCODING_H_ - -#include "core/fxge/include/fx_font.h" - -#define ENCODING_INTERNAL 0 -#define ENCODING_UNICODE 1 - -#ifdef PDF_ENABLE_XFA -#define FXFM_ENC_TAG(a, b, c, d) \ - (((uint32_t)(a) << 24) | ((uint32_t)(b) << 16) | ((uint32_t)(c) << 8) | \ - (uint32_t)(d)) -#define FXFM_ENCODING_NONE FXFM_ENC_TAG(0, 0, 0, 0) -#define FXFM_ENCODING_MS_SYMBOL FXFM_ENC_TAG('s', 'y', 'm', 'b') -#define FXFM_ENCODING_UNICODE FXFM_ENC_TAG('u', 'n', 'i', 'c') -#define FXFM_ENCODING_MS_SJIS FXFM_ENC_TAG('s', 'j', 'i', 's') -#define FXFM_ENCODING_MS_GB2312 FXFM_ENC_TAG('g', 'b', ' ', ' ') -#define FXFM_ENCODING_MS_BIG5 FXFM_ENC_TAG('b', 'i', 'g', '5') -#define FXFM_ENCODING_MS_WANSUNG FXFM_ENC_TAG('w', 'a', 'n', 's') -#define FXFM_ENCODING_MS_JOHAB FXFM_ENC_TAG('j', 'o', 'h', 'a') -#define FXFM_ENCODING_ADOBE_STANDARD FXFM_ENC_TAG('A', 'D', 'O', 'B') -#define FXFM_ENCODING_ADOBE_EXPERT FXFM_ENC_TAG('A', 'D', 'B', 'E') -#define FXFM_ENCODING_ADOBE_CUSTOM FXFM_ENC_TAG('A', 'D', 'B', 'C') -#define FXFM_ENCODING_ADOBE_LATIN_1 FXFM_ENC_TAG('l', 'a', 't', '1') -#define FXFM_ENCODING_OLD_LATIN_2 FXFM_ENC_TAG('l', 'a', 't', '2') -#define FXFM_ENCODING_APPLE_ROMAN FXFM_ENC_TAG('a', 'r', 'm', 'n') -#endif // PDF_ENABLE_XFA - -class CFX_UnicodeEncoding { - public: - explicit CFX_UnicodeEncoding(CFX_Font* pFont); - virtual ~CFX_UnicodeEncoding(); - - virtual uint32_t GlyphFromCharCode(uint32_t charcode); - - protected: - CFX_Font* m_pFont; // Unowned, not nullptr. -}; - -#endif // CORE_FXGE_INCLUDE_CFX_UNICODEENCODING_H_ diff --git a/core/fxge/include/cfx_unicodeencodingex.h b/core/fxge/include/cfx_unicodeencodingex.h deleted file mode 100644 index 680b8fb6bd..0000000000 --- a/core/fxge/include/cfx_unicodeencodingex.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_FXGE_INCLUDE_CFX_UNICODEENCODINGEX_H_ -#define CORE_FXGE_INCLUDE_CFX_UNICODEENCODINGEX_H_ - -#include -#include -#include - -#include "core/fxcrt/fx_system.h" -#include "core/fxge/include/cfx_unicodeencoding.h" -#include "core/fxge/include/fx_dib.h" -#include "core/fxge/include/fx_freetype.h" - -class CFX_UnicodeEncodingEx : public CFX_UnicodeEncoding { - public: - CFX_UnicodeEncodingEx(CFX_Font* pFont, uint32_t EncodingID); - ~CFX_UnicodeEncodingEx() override; - - // CFX_UnicodeEncoding: - uint32_t GlyphFromCharCode(uint32_t charcode) override; - - uint32_t CharCodeFromUnicode(FX_WCHAR Unicode) const; - - private: - uint32_t m_nEncodingID; -}; - -CFX_UnicodeEncodingEx* FX_CreateFontEncodingEx( - CFX_Font* pFont, - uint32_t nEncodingID = FXFM_ENCODING_NONE); - -#endif // CORE_FXGE_INCLUDE_CFX_UNICODEENCODINGEX_H_ diff --git a/core/fxge/include/cfx_windowsdevice.h b/core/fxge/include/cfx_windowsdevice.h deleted file mode 100644 index 906442d3d9..0000000000 --- a/core/fxge/include/cfx_windowsdevice.h +++ /dev/null @@ -1,39 +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_FXGE_INCLUDE_CFX_WINDOWSDEVICE_H_ -#define CORE_FXGE_INCLUDE_CFX_WINDOWSDEVICE_H_ - -#ifdef _WIN32 -#ifndef _WINDOWS_ -#include -#endif - -class IFX_RenderDeviceDriver; - -#if defined(PDFIUM_PRINT_TEXT_WITH_GDI) -typedef void (*PDFiumEnsureTypefaceCharactersAccessible)(const LOGFONT* font, - const wchar_t* text, - size_t text_length); - -extern bool g_pdfium_print_text_with_gdi; -extern PDFiumEnsureTypefaceCharactersAccessible - g_pdfium_typeface_accessible_func; -#endif - -class CFX_WindowsDevice : public CFX_RenderDevice { - public: - static IFX_RenderDeviceDriver* CreateDriver(HDC hDC); - - explicit CFX_WindowsDevice(HDC hDC); - ~CFX_WindowsDevice() override; - - HDC GetDC() const; -}; - -#endif // _WIN32 - -#endif // CORE_FXGE_INCLUDE_CFX_WINDOWSDEVICE_H_ diff --git a/core/fxge/include/fx_dib.h b/core/fxge/include/fx_dib.h deleted file mode 100644 index 2eaa38ab5e..0000000000 --- a/core/fxge/include/fx_dib.h +++ /dev/null @@ -1,680 +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_FXGE_INCLUDE_FX_DIB_H_ -#define CORE_FXGE_INCLUDE_FX_DIB_H_ - -#include -#include - -#include "core/fxcrt/cfx_count_ref.h" -#include "core/fxcrt/fx_basic.h" -#include "core/fxcrt/fx_coordinates.h" - -enum FXDIB_Format { - FXDIB_Invalid = 0, - FXDIB_1bppMask = 0x101, - FXDIB_1bppRgb = 0x001, - FXDIB_1bppCmyk = 0x401, - FXDIB_8bppMask = 0x108, - FXDIB_8bppRgb = 0x008, - FXDIB_8bppRgba = 0x208, - FXDIB_8bppCmyk = 0x408, - FXDIB_8bppCmyka = 0x608, - FXDIB_Rgb = 0x018, - FXDIB_Rgba = 0x218, - FXDIB_Rgb32 = 0x020, - FXDIB_Argb = 0x220, - FXDIB_Cmyk = 0x420, - FXDIB_Cmyka = 0x620, -}; - -enum FXDIB_Channel { - FXDIB_Red = 1, - FXDIB_Green, - FXDIB_Blue, - FXDIB_Cyan, - FXDIB_Magenta, - FXDIB_Yellow, - FXDIB_Black, - FXDIB_Alpha -}; - -#define FXDIB_DOWNSAMPLE 0x04 -#define FXDIB_INTERPOL 0x20 -#define FXDIB_BICUBIC_INTERPOL 0x80 -#define FXDIB_NOSMOOTH 0x100 -#define FXDIB_BLEND_NORMAL 0 -#define FXDIB_BLEND_MULTIPLY 1 -#define FXDIB_BLEND_SCREEN 2 -#define FXDIB_BLEND_OVERLAY 3 -#define FXDIB_BLEND_DARKEN 4 -#define FXDIB_BLEND_LIGHTEN 5 - -#define FXDIB_BLEND_COLORDODGE 6 -#define FXDIB_BLEND_COLORBURN 7 -#define FXDIB_BLEND_HARDLIGHT 8 -#define FXDIB_BLEND_SOFTLIGHT 9 -#define FXDIB_BLEND_DIFFERENCE 10 -#define FXDIB_BLEND_EXCLUSION 11 -#define FXDIB_BLEND_NONSEPARABLE 21 -#define FXDIB_BLEND_HUE 21 -#define FXDIB_BLEND_SATURATION 22 -#define FXDIB_BLEND_COLOR 23 -#define FXDIB_BLEND_LUMINOSITY 24 -#define FXDIB_BLEND_UNSUPPORTED -1 -typedef uint32_t FX_ARGB; -typedef uint32_t FX_COLORREF; -typedef uint32_t FX_CMYK; -class CFX_ClipRgn; -class CFX_DIBSource; -class CFX_DIBitmap; -class CStretchEngine; - -#define FXSYS_RGB(r, g, b) ((r) | ((g) << 8) | ((b) << 16)) -#define FXSYS_GetRValue(rgb) ((rgb)&0xff) -#define FXSYS_GetGValue(rgb) (((rgb) >> 8) & 0xff) -#define FXSYS_GetBValue(rgb) (((rgb) >> 16) & 0xff) -#define FX_CCOLOR(val) (255 - (val)) -#define FXSYS_CMYK(c, m, y, k) (((c) << 24) | ((m) << 16) | ((y) << 8) | (k)) -#define FXSYS_GetCValue(cmyk) ((uint8_t)((cmyk) >> 24) & 0xff) -#define FXSYS_GetMValue(cmyk) ((uint8_t)((cmyk) >> 16) & 0xff) -#define FXSYS_GetYValue(cmyk) ((uint8_t)((cmyk) >> 8) & 0xff) -#define FXSYS_GetKValue(cmyk) ((uint8_t)(cmyk)&0xff) -void CmykDecode(FX_CMYK cmyk, int& c, int& m, int& y, int& k); -inline FX_CMYK CmykEncode(int c, int m, int y, int k) { - return (c << 24) | (m << 16) | (y << 8) | k; -} -void ArgbDecode(FX_ARGB argb, int& a, int& r, int& g, int& b); -void ArgbDecode(FX_ARGB argb, int& a, FX_COLORREF& rgb); -inline FX_ARGB ArgbEncode(int a, int r, int g, int b) { - return (a << 24) | (r << 16) | (g << 8) | b; -} -FX_ARGB ArgbEncode(int a, FX_COLORREF rgb); -#define FXARGB_A(argb) ((uint8_t)((argb) >> 24)) -#define FXARGB_R(argb) ((uint8_t)((argb) >> 16)) -#define FXARGB_G(argb) ((uint8_t)((argb) >> 8)) -#define FXARGB_B(argb) ((uint8_t)(argb)) -#define FXARGB_MAKE(a, r, g, b) \ - (((uint32_t)(a) << 24) | ((r) << 16) | ((g) << 8) | (b)) -#define FXARGB_MUL_ALPHA(argb, alpha) \ - (((((argb) >> 24) * (alpha) / 255) << 24) | ((argb)&0xffffff)) -#define FXRGB2GRAY(r, g, b) (((b)*11 + (g)*59 + (r)*30) / 100) -#define FXCMYK2GRAY(c, m, y, k) \ - (((255 - (c)) * (255 - (k)) * 30 + (255 - (m)) * (255 - (k)) * 59 + \ - (255 - (y)) * (255 - (k)) * 11) / \ - 25500) -#define FXDIB_ALPHA_MERGE(backdrop, source, source_alpha) \ - (((backdrop) * (255 - (source_alpha)) + (source) * (source_alpha)) / 255) -#define FXDIB_ALPHA_UNION(dest, src) ((dest) + (src) - (dest) * (src) / 255) -#define FXCMYK_GETDIB(p) \ - ((((uint8_t*)(p))[0] << 24 | (((uint8_t*)(p))[1] << 16) | \ - (((uint8_t*)(p))[2] << 8) | ((uint8_t*)(p))[3])) -#define FXCMYK_SETDIB(p, cmyk) ((uint8_t*)(p))[0] = (uint8_t)((cmyk) >> 24), \ - ((uint8_t*)(p))[1] = (uint8_t)((cmyk) >> 16), \ - ((uint8_t*)(p))[2] = (uint8_t)((cmyk) >> 8), \ - ((uint8_t*)(p))[3] = (uint8_t)(cmyk)) -#define FXARGB_GETDIB(p) \ - ((((uint8_t*)(p))[0]) | (((uint8_t*)(p))[1] << 8) | \ - (((uint8_t*)(p))[2] << 16) | (((uint8_t*)(p))[3] << 24)) -#define FXARGB_SETDIB(p, argb) \ - ((uint8_t*)(p))[0] = (uint8_t)(argb), \ - ((uint8_t*)(p))[1] = (uint8_t)((argb) >> 8), \ - ((uint8_t*)(p))[2] = (uint8_t)((argb) >> 16), \ - ((uint8_t*)(p))[3] = (uint8_t)((argb) >> 24) -#define FXARGB_COPY(dest, src) \ - *(uint8_t*)(dest) = *(uint8_t*)(src), \ - *((uint8_t*)(dest) + 1) = *((uint8_t*)(src) + 1), \ - *((uint8_t*)(dest) + 2) = *((uint8_t*)(src) + 2), \ - *((uint8_t*)(dest) + 3) = *((uint8_t*)(src) + 3) -#define FXCMYK_COPY(dest, src) \ - *(uint8_t*)(dest) = *(uint8_t*)(src), \ - *((uint8_t*)(dest) + 1) = *((uint8_t*)(src) + 1), \ - *((uint8_t*)(dest) + 2) = *((uint8_t*)(src) + 2), \ - *((uint8_t*)(dest) + 3) = *((uint8_t*)(src) + 3) -#define FXARGB_SETRGBORDERDIB(p, argb) \ - ((uint8_t*)(p))[3] = (uint8_t)(argb >> 24), \ - ((uint8_t*)(p))[0] = (uint8_t)((argb) >> 16), \ - ((uint8_t*)(p))[1] = (uint8_t)((argb) >> 8), \ - ((uint8_t*)(p))[2] = (uint8_t)(argb) -#define FXARGB_GETRGBORDERDIB(p) \ - (((uint8_t*)(p))[2]) | (((uint8_t*)(p))[1] << 8) | \ - (((uint8_t*)(p))[0] << 16) | (((uint8_t*)(p))[3] << 24) -#define FXARGB_RGBORDERCOPY(dest, src) \ - *((uint8_t*)(dest) + 3) = *((uint8_t*)(src) + 3), \ - *(uint8_t*)(dest) = *((uint8_t*)(src) + 2), \ - *((uint8_t*)(dest) + 1) = *((uint8_t*)(src) + 1), \ - *((uint8_t*)(dest) + 2) = *((uint8_t*)(src)) -#define FXARGB_TODIB(argb) (argb) -#define FXCMYK_TODIB(cmyk) \ - ((uint8_t)((cmyk) >> 24) | ((uint8_t)((cmyk) >> 16)) << 8 | \ - ((uint8_t)((cmyk) >> 8)) << 16 | ((uint8_t)(cmyk) << 24)) -#define FXARGB_TOBGRORDERDIB(argb) \ - ((uint8_t)(argb >> 16) | ((uint8_t)(argb >> 8)) << 8 | \ - ((uint8_t)(argb)) << 16 | ((uint8_t)(argb >> 24) << 24)) -#define FXGETFLAG_COLORTYPE(flag) (uint8_t)((flag) >> 8) -#define FXGETFLAG_ALPHA_FILL(flag) (uint8_t)(flag) - -FX_BOOL ConvertBuffer(FXDIB_Format dest_format, - uint8_t* dest_buf, - int dest_pitch, - int width, - int height, - const CFX_DIBSource* pSrcBitmap, - int src_left, - int src_top, - std::unique_ptr* pal); - -class CFX_DIBSource { - public: - virtual ~CFX_DIBSource(); - - virtual uint8_t* GetBuffer() const; - virtual const uint8_t* GetScanline(int line) const = 0; - virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const; - virtual void DownSampleScanline(int line, - uint8_t* dest_scan, - int dest_bpp, - int dest_width, - FX_BOOL bFlipX, - int clip_left, - int clip_width) const = 0; - - int GetWidth() const { return m_Width; } - int GetHeight() const { return m_Height; } - - FXDIB_Format GetFormat() const { - return (FXDIB_Format)(m_AlphaFlag * 0x100 + m_bpp); - } - uint32_t GetPitch() const { return m_Pitch; } - uint32_t* GetPalette() const { return m_pPalette.get(); } - int GetBPP() const { return m_bpp; } - - // TODO(thestig): Investigate this. Given the possible values of FXDIB_Format, - // it feels as though this should be implemented as !!(m_AlphaFlag & 1) and - // IsOpaqueImage() below should never be able to return TRUE. - bool IsAlphaMask() const { return m_AlphaFlag == 1; } - bool HasAlpha() const { return !!(m_AlphaFlag & 2); } - bool IsOpaqueImage() const { return !(m_AlphaFlag & 3); } - bool IsCmykImage() const { return !!(m_AlphaFlag & 4); } - - int GetPaletteSize() const { - return IsAlphaMask() ? 0 : (m_bpp == 1 ? 2 : (m_bpp == 8 ? 256 : 0)); - } - - uint32_t GetPaletteEntry(int index) const; - - void SetPaletteEntry(int index, uint32_t color); - uint32_t GetPaletteArgb(int index) const { return GetPaletteEntry(index); } - void SetPaletteArgb(int index, uint32_t color) { - SetPaletteEntry(index, color); - } - - void CopyPalette(const uint32_t* pSrcPal); - - CFX_DIBitmap* Clone(const FX_RECT* pClip = nullptr) const; - CFX_DIBitmap* CloneConvert(FXDIB_Format format) const; - - CFX_DIBitmap* StretchTo(int dest_width, - int dest_height, - uint32_t flags = 0, - const FX_RECT* pClip = nullptr) const; - CFX_DIBitmap* TransformTo(const CFX_Matrix* pMatrix, - int& left, - int& top, - uint32_t flags = 0, - const FX_RECT* pClip = nullptr) const; - - CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = nullptr) const; - FX_BOOL CopyAlphaMask(const CFX_DIBSource* pAlphaMask, - const FX_RECT* pClip = nullptr); - - CFX_DIBitmap* SwapXY(FX_BOOL bXFlip, - FX_BOOL bYFlip, - const FX_RECT* pClip = nullptr) const; - - CFX_DIBitmap* FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const; - - void GetOverlapRect(int& dest_left, - int& dest_top, - int& width, - int& height, - int src_width, - int src_height, - int& src_left, - int& src_top, - const CFX_ClipRgn* pClipRgn); - -#if defined _SKIA_SUPPORT_ - void DebugVerifyBitmapIsPreMultiplied(void* buffer = nullptr) const; -#endif - - CFX_DIBitmap* m_pAlphaMask; - - protected: - CFX_DIBSource(); - - void BuildPalette(); - FX_BOOL BuildAlphaMask(); - int FindPalette(uint32_t color) const; - void GetPalette(uint32_t* pal, int alpha) const; - - int m_Width; - int m_Height; - int m_bpp; - uint32_t m_AlphaFlag; - uint32_t m_Pitch; - // TODO(weili): Use std::vector for this. - std::unique_ptr m_pPalette; -}; - -class CFX_DIBitmap : public CFX_DIBSource { - public: - CFX_DIBitmap(); - explicit CFX_DIBitmap(const CFX_DIBitmap& src); - ~CFX_DIBitmap() override; - - FX_BOOL Create(int width, - int height, - FXDIB_Format format, - uint8_t* pBuffer = nullptr, - int pitch = 0); - - FX_BOOL Copy(const CFX_DIBSource* pSrc); - - // CFX_DIBSource - uint8_t* GetBuffer() const override; - const uint8_t* GetScanline(int line) const override; - void DownSampleScanline(int line, - uint8_t* dest_scan, - int dest_bpp, - int dest_width, - FX_BOOL bFlipX, - int clip_left, - int clip_width) const override; - - void TakeOver(CFX_DIBitmap* pSrcBitmap); - - FX_BOOL ConvertFormat(FXDIB_Format format); - - void Clear(uint32_t color); - - uint32_t GetPixel(int x, int y) const; - - void SetPixel(int x, int y, uint32_t color); - - FX_BOOL LoadChannel(FXDIB_Channel destChannel, - const CFX_DIBSource* pSrcBitmap, - FXDIB_Channel srcChannel); - - FX_BOOL LoadChannel(FXDIB_Channel destChannel, int value); - - FX_BOOL MultiplyAlpha(int alpha); - - FX_BOOL MultiplyAlpha(const CFX_DIBSource* pAlphaMask); - - FX_BOOL TransferBitmap(int dest_left, - int dest_top, - int width, - int height, - const CFX_DIBSource* pSrcBitmap, - int src_left, - int src_top); - - FX_BOOL CompositeBitmap(int dest_left, - int dest_top, - int width, - int height, - const CFX_DIBSource* pSrcBitmap, - int src_left, - int src_top, - int blend_type = FXDIB_BLEND_NORMAL, - const CFX_ClipRgn* pClipRgn = nullptr, - FX_BOOL bRgbByteOrder = FALSE, - void* pIccTransform = nullptr); - - FX_BOOL TransferMask(int dest_left, - int dest_top, - int width, - int height, - const CFX_DIBSource* pMask, - uint32_t color, - int src_left, - int src_top, - int alpha_flag = 0, - void* pIccTransform = nullptr); - - FX_BOOL CompositeMask(int dest_left, - int dest_top, - int width, - int height, - const CFX_DIBSource* pMask, - uint32_t color, - int src_left, - int src_top, - int blend_type = FXDIB_BLEND_NORMAL, - const CFX_ClipRgn* pClipRgn = nullptr, - FX_BOOL bRgbByteOrder = FALSE, - int alpha_flag = 0, - void* pIccTransform = nullptr); - - FX_BOOL CompositeRect(int dest_left, - int dest_top, - int width, - int height, - uint32_t color, - int alpha_flag = 0, - void* pIccTransform = nullptr); - - FX_BOOL ConvertColorScale(uint32_t forecolor, uint32_t backcolor); - - protected: - FX_BOOL GetGrayData(void* pIccTransform = nullptr); - - uint8_t* m_pBuffer; - FX_BOOL m_bExtBuf; -}; - -class CFX_DIBExtractor { - public: - explicit CFX_DIBExtractor(const CFX_DIBSource* pSrc); - ~CFX_DIBExtractor(); - - CFX_DIBitmap* GetBitmap() { return m_pBitmap.get(); } - - private: - std::unique_ptr m_pBitmap; -}; - -typedef CFX_CountRef CFX_DIBitmapRef; - -class CFX_FilteredDIB : public CFX_DIBSource { - public: - CFX_FilteredDIB(); - ~CFX_FilteredDIB() override; - - void LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc = FALSE); - - virtual FXDIB_Format GetDestFormat() = 0; - - virtual uint32_t* GetDestPalette() = 0; - - virtual void TranslateScanline(const uint8_t* src_buf, - std::vector* dest_buf) const = 0; - - virtual void TranslateDownSamples(uint8_t* dest_buf, - const uint8_t* src_buf, - int pixels, - int Bpp) const = 0; - - protected: - // CFX_DIBSource - const uint8_t* GetScanline(int line) const override; - void DownSampleScanline(int line, - uint8_t* dest_scan, - int dest_bpp, - int dest_width, - FX_BOOL bFlipX, - int clip_left, - int clip_width) const override; - - const CFX_DIBSource* m_pSrc; - FX_BOOL m_bAutoDropSrc; - mutable std::vector m_Scanline; -}; - -class IFX_ScanlineComposer { - public: - virtual ~IFX_ScanlineComposer() {} - - virtual void ComposeScanline(int line, - const uint8_t* scanline, - const uint8_t* scan_extra_alpha = nullptr) = 0; - - virtual FX_BOOL SetInfo(int width, - int height, - FXDIB_Format src_format, - uint32_t* pSrcPalette) = 0; -}; - -class CFX_ScanlineCompositor { - public: - CFX_ScanlineCompositor(); - - ~CFX_ScanlineCompositor(); - - FX_BOOL Init(FXDIB_Format dest_format, - FXDIB_Format src_format, - int32_t width, - uint32_t* pSrcPalette, - uint32_t mask_color, - int blend_type, - FX_BOOL bClip, - FX_BOOL bRgbByteOrder = FALSE, - int alpha_flag = 0, - void* pIccTransform = nullptr); - - void CompositeRgbBitmapLine(uint8_t* dest_scan, - const uint8_t* src_scan, - int width, - const uint8_t* clip_scan, - const uint8_t* src_extra_alpha = nullptr, - uint8_t* dst_extra_alpha = nullptr); - - void CompositePalBitmapLine(uint8_t* dest_scan, - const uint8_t* src_scan, - int src_left, - int width, - const uint8_t* clip_scan, - const uint8_t* src_extra_alpha = nullptr, - uint8_t* dst_extra_alpha = nullptr); - - void CompositeByteMaskLine(uint8_t* dest_scan, - const uint8_t* src_scan, - int width, - const uint8_t* clip_scan, - uint8_t* dst_extra_alpha = nullptr); - - void CompositeBitMaskLine(uint8_t* dest_scan, - const uint8_t* src_scan, - int src_left, - int width, - const uint8_t* clip_scan, - uint8_t* dst_extra_alpha = nullptr); - - protected: - int m_Transparency; - FXDIB_Format m_SrcFormat, m_DestFormat; - uint32_t* m_pSrcPalette; - - int m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue, m_MaskBlack; - int m_BlendType; - void* m_pIccTransform; - uint8_t* m_pCacheScanline; - int m_CacheSize; - FX_BOOL m_bRgbByteOrder; -}; - -class CFX_BitmapComposer : public IFX_ScanlineComposer { - public: - CFX_BitmapComposer(); - ~CFX_BitmapComposer() override; - - void Compose(CFX_DIBitmap* pDest, - const CFX_ClipRgn* pClipRgn, - int bitmap_alpha, - uint32_t mask_color, - FX_RECT& dest_rect, - FX_BOOL bVertical, - FX_BOOL bFlipX, - FX_BOOL bFlipY, - FX_BOOL bRgbByteOrder = FALSE, - int alpha_flag = 0, - void* pIccTransform = nullptr, - int blend_type = FXDIB_BLEND_NORMAL); - - // IFX_ScanlineComposer - FX_BOOL SetInfo(int width, - int height, - FXDIB_Format src_format, - uint32_t* pSrcPalette) override; - - void ComposeScanline(int line, - const uint8_t* scanline, - const uint8_t* scan_extra_alpha) override; - - protected: - void DoCompose(uint8_t* dest_scan, - const uint8_t* src_scan, - int dest_width, - const uint8_t* clip_scan, - const uint8_t* src_extra_alpha = nullptr, - uint8_t* dst_extra_alpha = nullptr); - CFX_DIBitmap* m_pBitmap; - const CFX_ClipRgn* m_pClipRgn; - FXDIB_Format m_SrcFormat; - int m_DestLeft, m_DestTop, m_DestWidth, m_DestHeight, m_BitmapAlpha; - uint32_t m_MaskColor; - const CFX_DIBitmap* m_pClipMask; - CFX_ScanlineCompositor m_Compositor; - FX_BOOL m_bVertical, m_bFlipX, m_bFlipY; - int m_AlphaFlag; - void* m_pIccTransform; - FX_BOOL m_bRgbByteOrder; - int m_BlendType; - void ComposeScanlineV(int line, - const uint8_t* scanline, - const uint8_t* scan_extra_alpha = nullptr); - uint8_t* m_pScanlineV; - uint8_t* m_pClipScanV; - uint8_t* m_pAddClipScan; - uint8_t* m_pScanlineAlphaV; -}; - -class CFX_BitmapStorer : public IFX_ScanlineComposer { - public: - CFX_BitmapStorer(); - ~CFX_BitmapStorer() override; - - // IFX_ScanlineComposer - void ComposeScanline(int line, - const uint8_t* scanline, - const uint8_t* scan_extra_alpha) override; - FX_BOOL SetInfo(int width, - int height, - FXDIB_Format src_format, - uint32_t* pSrcPalette) override; - - CFX_DIBitmap* GetBitmap() { return m_pBitmap.get(); } - std::unique_ptr Detach(); - void Replace(std::unique_ptr pBitmap); - - private: - std::unique_ptr m_pBitmap; -}; - -class CFX_ImageStretcher { - public: - CFX_ImageStretcher(IFX_ScanlineComposer* pDest, - const CFX_DIBSource* pSource, - int dest_width, - int dest_height, - const FX_RECT& bitmap_rect, - uint32_t flags); - ~CFX_ImageStretcher(); - - FX_BOOL Start(); - FX_BOOL Continue(IFX_Pause* pPause); - - const CFX_DIBSource* source() { return m_pSource; } - - private: - FX_BOOL StartQuickStretch(); - FX_BOOL StartStretch(); - FX_BOOL ContinueQuickStretch(IFX_Pause* pPause); - FX_BOOL ContinueStretch(IFX_Pause* pPause); - - IFX_ScanlineComposer* const m_pDest; - const CFX_DIBSource* const m_pSource; - std::unique_ptr m_pStretchEngine; - std::unique_ptr m_pScanline; - std::unique_ptr m_pMaskScanline; - const uint32_t m_Flags; - FX_BOOL m_bFlipX; - FX_BOOL m_bFlipY; - int m_DestWidth; - int m_DestHeight; - FX_RECT m_ClipRect; - const FXDIB_Format m_DestFormat; - const int m_DestBPP; - int m_LineIndex; -}; - -class CFX_ImageTransformer { - public: - CFX_ImageTransformer(const CFX_DIBSource* pSrc, - const CFX_Matrix* pMatrix, - int flags, - const FX_RECT* pClip); - ~CFX_ImageTransformer(); - - FX_BOOL Start(); - FX_BOOL Continue(IFX_Pause* pPause); - - const FX_RECT& result() const { return m_result; } - std::unique_ptr DetachBitmap(); - - private: - const CFX_DIBSource* const m_pSrc; - const CFX_Matrix* const m_pMatrix; - const FX_RECT* const m_pClip; - FX_RECT m_StretchClip; - FX_RECT m_result; - CFX_Matrix m_dest2stretch; - std::unique_ptr m_Stretcher; - CFX_BitmapStorer m_Storer; - const uint32_t m_Flags; - int m_Status; -}; - -class CFX_ImageRenderer { - public: - CFX_ImageRenderer(); - ~CFX_ImageRenderer(); - - FX_BOOL Start(CFX_DIBitmap* pDevice, - const CFX_ClipRgn* pClipRgn, - const CFX_DIBSource* pSource, - int bitmap_alpha, - uint32_t mask_color, - const CFX_Matrix* pMatrix, - uint32_t dib_flags, - FX_BOOL bRgbByteOrder = FALSE, - int alpha_flag = 0, - void* pIccTransform = nullptr, - int blend_type = FXDIB_BLEND_NORMAL); - - FX_BOOL Continue(IFX_Pause* pPause); - - protected: - CFX_DIBitmap* m_pDevice; - const CFX_ClipRgn* m_pClipRgn; - int m_BitmapAlpha; - uint32_t m_MaskColor; - CFX_Matrix m_Matrix; - std::unique_ptr m_pTransformer; - std::unique_ptr m_Stretcher; - CFX_BitmapComposer m_Composer; - int m_Status; - FX_RECT m_ClipBox; - uint32_t m_Flags; - int m_AlphaFlag; - void* m_pIccTransform; - FX_BOOL m_bRgbByteOrder; - int m_BlendType; -}; - -#endif // CORE_FXGE_INCLUDE_FX_DIB_H_ diff --git a/core/fxge/include/fx_font.h b/core/fxge/include/fx_font.h deleted file mode 100644 index 2151bf65bb..0000000000 --- a/core/fxge/include/fx_font.h +++ /dev/null @@ -1,248 +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_FXGE_INCLUDE_FX_FONT_H_ -#define CORE_FXGE_INCLUDE_FX_FONT_H_ - -#include -#include - -#include "core/fxcrt/fx_system.h" -#include "core/fxge/include/cfx_substfont.h" -#include "core/fxge/include/fx_dib.h" -#include "core/fxge/include/fx_freetype.h" - -typedef struct FT_FaceRec_* FXFT_Face; -typedef void* FXFT_Library; - -class CFX_FaceCache; -class CFX_GlyphBitmap; -class CFX_PathData; -class CFX_SizeGlyphCache; - -#ifdef _SKIA_SUPPORT_ -class SkTypeface; - -using CFX_TypeFace = SkTypeface; -#endif - -/* Character sets for the font */ -#define FXFONT_ANSI_CHARSET 0 -#define FXFONT_DEFAULT_CHARSET 1 -#define FXFONT_SYMBOL_CHARSET 2 -#define FXFONT_SHIFTJIS_CHARSET 128 -#define FXFONT_HANGUL_CHARSET 129 -#define FXFONT_GB2312_CHARSET 134 -#define FXFONT_CHINESEBIG5_CHARSET 136 -#define FXFONT_THAI_CHARSET 222 -#define FXFONT_EASTEUROPE_CHARSET 238 -#define FXFONT_RUSSIAN_CHARSET 204 -#define FXFONT_GREEK_CHARSET 161 -#define FXFONT_TURKISH_CHARSET 162 -#define FXFONT_HEBREW_CHARSET 177 -#define FXFONT_ARABIC_CHARSET 178 -#define FXFONT_BALTIC_CHARSET 186 -#define FXFONT_JOHAB_CHARSET 130 -#define FXFONT_VIETNAMESE_CHARSET 163 - -/* Font pitch and family flags */ -#define FXFONT_FF_FIXEDPITCH 1 -#define FXFONT_FF_ROMAN (1 << 4) -#define FXFONT_FF_SCRIPT (4 << 4) - -/* Typical weight values */ -#define FXFONT_FW_NORMAL 400 -#define FXFONT_FW_BOLD 700 - -/* Font styles */ -#define FXFONT_FIXED_PITCH 0x01 -#define FXFONT_SERIF 0x02 -#define FXFONT_SYMBOLIC 0x04 -#define FXFONT_SCRIPT 0x08 -#define FXFONT_ITALIC 0x40 -#define FXFONT_BOLD 0x40000 -#define FXFONT_USEEXTERNATTR 0x80000 -#define FXFONT_CIDFONT 0x100000 -#ifdef PDF_ENABLE_XFA -#define FXFONT_EXACTMATCH 0x80000000 -#endif // PDF_ENABLE_XFA - -#define CHARSET_FLAG_ANSI 1 -#define CHARSET_FLAG_SYMBOL 2 -#define CHARSET_FLAG_SHIFTJIS 4 -#define CHARSET_FLAG_BIG5 8 -#define CHARSET_FLAG_GB 16 -#define CHARSET_FLAG_KOREAN 32 - -#define GET_TT_SHORT(w) (uint16_t)(((w)[0] << 8) | (w)[1]) -#define GET_TT_LONG(w) \ - (uint32_t)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3]) - -// Sets the given transform on the font, and resets it to the identity when it -// goes out of scope. -class ScopedFontTransform { - public: - ScopedFontTransform(FT_Face face, FXFT_Matrix* matrix); - ~ScopedFontTransform(); - - private: - FT_Face m_Face; -}; - -class CFX_Font { - public: - CFX_Font(); - ~CFX_Font(); - - void LoadSubst(const CFX_ByteString& face_name, - FX_BOOL bTrueType, - uint32_t flags, - int weight, - int italic_angle, - int CharsetCP, - bool bVertical); - - FX_BOOL LoadEmbedded(const uint8_t* data, uint32_t size); - FXFT_Face GetFace() const { return m_Face; } - CFX_SubstFont* GetSubstFont() const { return m_pSubstFont.get(); } - -#ifdef PDF_ENABLE_XFA - FX_BOOL LoadFile(IFX_FileRead* pFile, - int nFaceIndex = 0, - int* pFaceCount = nullptr); - - FX_BOOL LoadClone(const CFX_Font* pFont); - void SetFace(FXFT_Face face); - void SetSubstFont(std::unique_ptr subst) { - m_pSubstFont = std::move(subst); - } -#endif // PDF_ENABLE_XFA - - const CFX_GlyphBitmap* LoadGlyphBitmap(uint32_t glyph_index, - FX_BOOL bFontStyle, - const CFX_Matrix* pMatrix, - int dest_width, - int anti_alias, - int& text_flags) const; - const CFX_PathData* LoadGlyphPath(uint32_t glyph_index, int dest_width) const; - -#ifdef _SKIA_SUPPORT_ - CFX_TypeFace* GetDeviceCache() const; -#endif - - int GetGlyphWidth(uint32_t glyph_index); - int GetAscent() const; - int GetDescent() const; - FX_BOOL GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox); - bool IsItalic() const; - bool IsBold() const; - bool IsFixedWidth() const; - bool IsVertical() const { return m_bVertical; } - CFX_ByteString GetPsName() const; - CFX_ByteString GetFamilyName() const; - CFX_ByteString GetFaceName() const; - bool IsTTFont() const; - FX_BOOL GetBBox(FX_RECT& bbox); - int GetHeight() const; - int GetULPos() const; - int GetULthickness() const; - int GetMaxAdvanceWidth() const; - FX_BOOL IsEmbedded() const { return m_bEmbedded; } - uint8_t* GetSubData() const { return m_pGsubData; } - void SetSubData(uint8_t* data) { m_pGsubData = data; } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - void* GetPlatformFont() const { return m_pPlatformFont; } - void SetPlatformFont(void* font) { m_pPlatformFont = font; } -#endif - uint8_t* GetFontData() const { return m_pFontData; } - uint32_t GetSize() const { return m_dwSize; } - void AdjustMMParams(int glyph_index, int width, int weight) const; - - static const size_t kAngleSkewArraySize = 30; - static const char s_AngleSkew[kAngleSkewArraySize]; - static const size_t kWeightPowArraySize = 100; - static const uint8_t s_WeightPow[kWeightPowArraySize]; - static const uint8_t s_WeightPow_11[kWeightPowArraySize]; - static const uint8_t s_WeightPow_SHIFTJIS[kWeightPowArraySize]; - -#ifdef PDF_ENABLE_XFA - protected: - CFX_BinaryBuf m_OtfFontData; - bool m_bShallowCopy; - FXFT_StreamRec* m_pOwnedStream; -#endif // PDF_ENABLE_XFA - - private: - friend class CFX_FaceCache; - CFX_PathData* LoadGlyphPathImpl(uint32_t glyph_index, - int dest_width = 0) const; - - private: - CFX_FaceCache* GetFaceCache() const; - - void ReleasePlatformResource(); - void DeleteFace(); - - void ClearFaceCache(); - - FXFT_Face m_Face; - mutable CFX_FaceCache* m_FaceCache; // not owned. - std::unique_ptr m_pSubstFont; - std::vector m_pFontDataAllocation; - uint8_t* m_pFontData; - uint8_t* m_pGsubData; - uint32_t m_dwSize; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - void* m_pPlatformFont; -#endif - bool m_bEmbedded; - bool m_bVertical; -}; - -class CFX_FontFaceInfo { - public: - CFX_FontFaceInfo(CFX_ByteString filePath, - CFX_ByteString faceName, - CFX_ByteString fontTables, - uint32_t fontOffset, - uint32_t fileSize); - - const CFX_ByteString m_FilePath; - const CFX_ByteString m_FaceName; - const CFX_ByteString m_FontTables; - const uint32_t m_FontOffset; - const uint32_t m_FileSize; - uint32_t m_Styles; - uint32_t m_Charsets; -}; - -class CFX_GlyphBitmap { - public: - int m_Top; - int m_Left; - CFX_DIBitmap m_Bitmap; -}; - -struct FXTEXT_GLYPHPOS { - const CFX_GlyphBitmap* m_pGlyph; - int m_OriginX; - int m_OriginY; - FX_FLOAT m_fOriginX; - FX_FLOAT m_fOriginY; -}; - -FX_RECT FXGE_GetGlyphsBBox(const std::vector& glyphs, - int anti_alias, - FX_FLOAT retinaScaleX = 1.0f, - FX_FLOAT retinaScaleY = 1.0f); - -CFX_ByteString GetNameFromTT(const uint8_t* name_table, - uint32_t name_table_size, - uint32_t name); - -int PDF_GetStandardFontName(CFX_ByteString* name); - -#endif // CORE_FXGE_INCLUDE_FX_FONT_H_ diff --git a/core/fxge/include/fx_freetype.h b/core/fxge/include/fx_freetype.h deleted file mode 100644 index 533974dc2e..0000000000 --- a/core/fxge/include/fx_freetype.h +++ /dev/null @@ -1,180 +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_FXGE_INCLUDE_FX_FREETYPE_H_ -#define CORE_FXGE_INCLUDE_FX_FREETYPE_H_ - -#include -#include FT_FREETYPE_H -#include FT_GLYPH_H -#include FT_LCD_FILTER_H -#include FT_MULTIPLE_MASTERS_H -#include FT_OUTLINE_H -#include FT_TRUETYPE_TABLES_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define FXFT_ENCODING_UNICODE FT_ENCODING_UNICODE -#define FXFT_ENCODING_ADOBE_STANDARD FT_ENCODING_ADOBE_STANDARD -#define FXFT_ENCODING_ADOBE_EXPERT FT_ENCODING_ADOBE_EXPERT -#define FXFT_ENCODING_ADOBE_LATIN_1 FT_ENCODING_ADOBE_LATIN_1 -#define FXFT_ENCODING_APPLE_ROMAN FT_ENCODING_APPLE_ROMAN -#define FXFT_ENCODING_ADOBE_CUSTOM FT_ENCODING_ADOBE_CUSTOM -#define FXFT_ENCODING_MS_SYMBOL FT_ENCODING_MS_SYMBOL -#define FXFT_ENCODING_GB2312 FT_ENCODING_GB2312 -#define FXFT_ENCODING_BIG5 FT_ENCODING_BIG5 -#define FXFT_ENCODING_SJIS FT_ENCODING_SJIS -#define FXFT_ENCODING_JOHAB FT_ENCODING_JOHAB -#define FXFT_ENCODING_WANSUNG FT_ENCODING_WANSUNG -#define FXFT_LOAD_NO_SCALE FT_LOAD_NO_SCALE -#define FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH \ - FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH -#define FXFT_RENDER_MODE_LCD FT_RENDER_MODE_LCD -#define FXFT_RENDER_MODE_MONO FT_RENDER_MODE_MONO -#define FXFT_RENDER_MODE_NORMAL FT_RENDER_MODE_NORMAL -#define FXFT_LOAD_IGNORE_TRANSFORM FT_LOAD_IGNORE_TRANSFORM -#define FXFT_LOAD_NO_BITMAP FT_LOAD_NO_BITMAP -#define FXFT_LOAD_NO_HINTING FT_LOAD_NO_HINTING -#define FXFT_PIXEL_MODE_MONO FT_PIXEL_MODE_MONO -#define FXFT_STYLE_FLAG_ITALIC FT_STYLE_FLAG_ITALIC -#define FXFT_STYLE_FLAG_BOLD FT_STYLE_FLAG_BOLD -#define FXFT_FACE_FLAG_SFNT FT_FACE_FLAG_SFNT -#define FXFT_FACE_FLAG_TRICKY (1L << 13) -typedef FT_MM_Var* FXFT_MM_Var; -typedef FT_Bitmap* FXFT_Bitmap; -#define FXFT_Matrix FT_Matrix -#define FXFT_Vector FT_Vector -#define FXFT_Outline_Funcs FT_Outline_Funcs -typedef FT_Open_Args FXFT_Open_Args; -typedef FT_StreamRec FXFT_StreamRec; -typedef FT_StreamRec* FXFT_Stream; -typedef FT_BBox FXFT_BBox; -typedef FT_Glyph FXFT_Glyph; -typedef FT_CharMap FXFT_CharMap; -#define FXFT_GLYPH_BBOX_PIXELS FT_GLYPH_BBOX_PIXELS -#define FXFT_Open_Face(library, args, index, face) \ - FT_Open_Face((FT_Library)(library), args, index, (FT_Face*)(face)) -#define FXFT_Done_Face(face) FT_Done_Face((FT_Face)(face)) -#define FXFT_Done_FreeType(library) FT_Done_FreeType((FT_Library)(library)) -#define FXFT_Init_FreeType(library) FT_Init_FreeType((FT_Library*)(library)) -#define FXFT_New_Memory_Face(library, base, size, index, face) \ - FT_New_Memory_Face((FT_Library)(library), base, size, index, (FT_Face*)(face)) -#define FXFT_New_Face(library, filename, index, face) \ - FT_New_Face((FT_Library)(library), filename, index, (FT_Face*)(face)) -#define FXFT_Get_Face_FreeType(face) ((FT_Face)face)->driver->root.library -#define FXFT_Select_Charmap(face, encoding) \ - FT_Select_Charmap((FT_Face)face, (FT_Encoding)encoding) -#define FXFT_Set_Charmap(face, charmap) \ - FT_Set_Charmap((FT_Face)face, (FT_CharMap)charmap) -#define FXFT_Load_Glyph(face, glyph_index, flags) \ - FT_Load_Glyph((FT_Face)face, glyph_index, flags) -#define FXFT_Get_Char_Index(face, code) FT_Get_Char_Index((FT_Face)face, code) -#define FXFT_Get_Glyph_Name(face, index, buffer, size) \ - FT_Get_Glyph_Name((FT_Face)face, index, buffer, size) -#define FXFT_Get_Name_Index(face, name) FT_Get_Name_Index((FT_Face)face, name) -#define FXFT_Has_Glyph_Names(face) \ - (((FT_Face)face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES) -#define FXFT_Get_Postscript_Name(face) FT_Get_Postscript_Name((FT_Face)face) -#define FXFT_Load_Sfnt_Table(face, tag, offset, buffer, length) \ - FT_Load_Sfnt_Table((FT_Face)face, tag, offset, buffer, length) -#define FXFT_Get_First_Char(face, glyph_index) \ - FT_Get_First_Char((FT_Face)face, glyph_index) -#define FXFT_Get_Next_Char(face, code, glyph_index) \ - FT_Get_Next_Char((FT_Face)face, code, glyph_index) -#define FXFT_Clear_Face_External_Stream(face) \ - (((FT_Face)face)->face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM) -#define FXFT_Get_Face_External_Stream(face) \ - (((FT_Face)face)->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM) -#define FXFT_Is_Face_TT_OT(face) \ - (((FT_Face)face)->face_flags & FT_FACE_FLAG_SFNT) -#define FXFT_Is_Face_Tricky(face) \ - (((FT_Face)face)->face_flags & FXFT_FACE_FLAG_TRICKY) -#define FXFT_Is_Face_fixedwidth(face) \ - (((FT_Face)face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH) -#define FXFT_Get_Face_Stream_Base(face) ((FT_Face)face)->stream->base -#define FXFT_Get_Face_Stream_Size(face) ((FT_Face)face)->stream->size -#define FXFT_Get_Face_Family_Name(face) ((FT_Face)face)->family_name -#define FXFT_Get_Face_Style_Name(face) ((FT_Face)face)->style_name -#define FXFT_Get_Face_Numfaces(face) ((FT_Face)face)->num_faces -#define FXFT_Get_Face_Faceindex(face) ((FT_Face)face)->face_index -#define FXFT_Is_Face_Italic(face) \ - (((FT_Face)face)->style_flags & FT_STYLE_FLAG_ITALIC) -#define FXFT_Is_Face_Bold(face) \ - (((FT_Face)face)->style_flags & FT_STYLE_FLAG_BOLD) -#define FXFT_Get_Face_Charmaps(face) ((FT_Face)face)->charmaps -#define FXFT_Get_Glyph_HoriBearingX(face) \ - ((FT_Face)face)->glyph->metrics.horiBearingX -#define FXFT_Get_Glyph_HoriBearingY(face) \ - ((FT_Face)face)->glyph->metrics.horiBearingY -#define FXFT_Get_Glyph_Width(face) ((FT_Face)face)->glyph->metrics.width -#define FXFT_Get_Glyph_Height(face) ((FT_Face)face)->glyph->metrics.height -#define FXFT_Get_Face_CharmapCount(face) ((FT_Face)face)->num_charmaps -#define FXFT_Get_Charmap_Encoding(charmap) ((FT_CharMap)charmap)->encoding -#define FXFT_Get_Face_Charmap(face) ((FT_Face)face)->charmap -#define FXFT_Get_Charmap_PlatformID(charmap) ((FT_CharMap)charmap)->platform_id -#define FXFT_Get_Charmap_EncodingID(charmap) ((FT_CharMap)charmap)->encoding_id -#define FXFT_Get_Face_UnitsPerEM(face) ((FT_Face)face)->units_per_EM -#define FXFT_Get_Face_xMin(face) ((FT_Face)face)->bbox.xMin -#define FXFT_Get_Face_xMax(face) ((FT_Face)face)->bbox.xMax -#define FXFT_Get_Face_yMin(face) ((FT_Face)face)->bbox.yMin -#define FXFT_Get_Face_yMax(face) ((FT_Face)face)->bbox.yMax -#define FXFT_Get_Face_Height(face) ((FT_Face)face)->height -#define FXFT_Get_Face_UnderLineThickness(face) \ - ((FT_Face)face)->underline_thickness -#define FXFT_Get_Face_UnderLinePosition(face) \ - ((FT_Face)face)->underline_position -#define FXFT_Get_Face_MaxAdvanceWidth(face) ((FT_Face)face)->max_advance_width -#define FXFT_Get_Face_Ascender(face) ((FT_Face)face)->ascender -#define FXFT_Get_Face_Descender(face) ((FT_Face)face)->descender -#define FXFT_Get_Glyph_HoriAdvance(face) \ - ((FT_Face)face)->glyph->metrics.horiAdvance -#define FXFT_Get_MM_Axis(var, index) &static_cast(var)->axis[index] -#define FXFT_Get_MM_Axis_Min(axis) ((FT_Var_Axis*)axis)->minimum -#define FXFT_Get_MM_Axis_Max(axis) ((FT_Var_Axis*)axis)->maximum -#define FXFT_Get_MM_Axis_Def(axis) ((FT_Var_Axis*)axis)->def -#define FXFT_Alloc(library, size) \ - ((FT_Library)library)->memory->alloc(((FT_Library)library)->memory, size) -#define FXFT_Free(face, p) \ - ((FT_Face)face)->memory->free(((FT_Face)face)->memory, p) -#define FXFT_Get_Glyph_Outline(face) &static_cast(face)->glyph->outline -#define FXFT_Get_Outline_Bbox(outline, cbox) FT_Outline_Get_CBox(outline, cbox) -#define FXFT_Render_Glyph(face, mode) \ - FT_Render_Glyph(((FT_Face)face)->glyph, (enum FT_Render_Mode_)mode) -#define FXFT_Get_MM_Var(face, p) FT_Get_MM_Var((FT_Face)face, p) -#define FXFT_Set_MM_Design_Coordinates(face, n, p) \ - FT_Set_MM_Design_Coordinates((FT_Face)face, n, p) -#define FXFT_Set_Pixel_Sizes(face, w, h) FT_Set_Pixel_Sizes((FT_Face)face, w, h) -#define FXFT_Set_Transform(face, m, d) FT_Set_Transform((FT_Face)face, m, d) -#define FXFT_Outline_Embolden(outline, s) FT_Outline_Embolden(outline, s) -#define FXFT_Get_Glyph_Bitmap(face) &static_cast(face)->glyph->bitmap -#define FXFT_Get_Bitmap_Width(bitmap) ((FT_Bitmap*)bitmap)->width -#define FXFT_Get_Bitmap_Rows(bitmap) ((FT_Bitmap*)bitmap)->rows -#define FXFT_Get_Bitmap_PixelMode(bitmap) ((FT_Bitmap*)bitmap)->pixel_mode -#define FXFT_Get_Bitmap_Pitch(bitmap) ((FT_Bitmap*)bitmap)->pitch -#define FXFT_Get_Bitmap_Buffer(bitmap) ((FT_Bitmap*)bitmap)->buffer -#define FXFT_Get_Glyph_BitmapLeft(face) ((FT_Face)face)->glyph->bitmap_left -#define FXFT_Get_Glyph_BitmapTop(face) ((FT_Face)face)->glyph->bitmap_top -#define FXFT_Outline_Decompose(outline, funcs, params) \ - FT_Outline_Decompose(outline, funcs, params) -#define FXFT_Set_Char_Size(face, char_width, char_height, horz_resolution, \ - vert_resolution) \ - FT_Set_Char_Size(face, char_width, char_height, horz_resolution, \ - vert_resolution) -#define FXFT_Get_Glyph(slot, aglyph) FT_Get_Glyph(slot, aglyph) -#define FXFT_Glyph_Get_CBox(glyph, bbox_mode, acbox) \ - FT_Glyph_Get_CBox(glyph, bbox_mode, acbox) -#define FXFT_Done_Glyph(glyph) FT_Done_Glyph(glyph) -#define FXFT_Library_SetLcdFilter(library, filter) \ - FT_Library_SetLcdFilter((FT_Library)(library), filter) -int FXFT_unicode_from_adobe_name(const char* glyph_name); -void FXFT_adobe_name_from_unicode(char* name, wchar_t unicode); -#ifdef __cplusplus -}; -#endif - -#endif // CORE_FXGE_INCLUDE_FX_FREETYPE_H_ diff --git a/core/fxge/include/ifx_renderdevicedriver.h b/core/fxge/include/ifx_renderdevicedriver.h deleted file mode 100644 index 995e82d654..0000000000 --- a/core/fxge/include/ifx_renderdevicedriver.h +++ /dev/null @@ -1,108 +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_FXGE_INCLUDE_IFX_RENDERDEVICEDRIVER_H_ -#define CORE_FXGE_INCLUDE_IFX_RENDERDEVICEDRIVER_H_ - -#include "core/fxcrt/fx_system.h" - -class CFX_DIBitmap; -class CFX_DIBSource; -class CFX_Font; -class CFX_GraphStateData; -class CFX_Matrix; -class CFX_PathData; -class CPDF_ShadingPattern; -class IFX_Pause; -struct FXTEXT_CHARPOS; -struct FX_RECT; - -class IFX_RenderDeviceDriver { - public: - virtual ~IFX_RenderDeviceDriver(); - - virtual int GetDeviceCaps(int caps_id) const = 0; - virtual CFX_Matrix GetCTM() const; - - virtual FX_BOOL StartRendering(); - virtual void EndRendering(); - virtual void SaveState() = 0; - virtual void RestoreState(bool bKeepSaved) = 0; - - virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, - const CFX_Matrix* pObject2Device, - int fill_mode) = 0; - virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, - const CFX_Matrix* pObject2Device, - const CFX_GraphStateData* pGraphState); - virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, - const CFX_Matrix* pObject2Device, - const CFX_GraphStateData* pGraphState, - uint32_t fill_color, - uint32_t stroke_color, - int fill_mode, - int blend_type) = 0; - virtual FX_BOOL SetPixel(int x, int y, uint32_t color); - virtual FX_BOOL FillRectWithBlend(const FX_RECT* pRect, - uint32_t fill_color, - int blend_type); - virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, - FX_FLOAT y1, - FX_FLOAT x2, - FX_FLOAT y2, - uint32_t color, - int blend_type); - - virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; - virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top); - virtual CFX_DIBitmap* GetBackDrop(); - virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, - uint32_t color, - const FX_RECT* pSrcRect, - int dest_left, - int dest_top, - int blend_type) = 0; - virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, - uint32_t color, - int dest_left, - int dest_top, - int dest_width, - int dest_height, - const FX_RECT* pClipRect, - uint32_t flags, - int blend_type) = 0; - virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, - int bitmap_alpha, - uint32_t color, - const CFX_Matrix* pMatrix, - uint32_t flags, - void*& handle, - int blend_type) = 0; - virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); - virtual void CancelDIBits(void* handle); - virtual FX_BOOL DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, - CFX_Font* pFont, - const CFX_Matrix* pObject2Device, - FX_FLOAT font_size, - uint32_t color); - virtual void* GetPlatformSurface() const; - virtual int GetDriverType() const; - virtual void ClearDriver(); - virtual FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, - const CFX_Matrix* pMatrix, - const FX_RECT& clip_rect, - int alpha, - FX_BOOL bAlphaMode); - virtual bool SetBitsWithMask(const CFX_DIBSource* pBitmap, - const CFX_DIBSource* pMask, - int left, - int top, - int bitmap_alpha, - int blend_type); -}; - -#endif // CORE_FXGE_INCLUDE_IFX_RENDERDEVICEDRIVER_H_ diff --git a/core/fxge/include/ifx_systemfontinfo.h b/core/fxge/include/ifx_systemfontinfo.h deleted file mode 100644 index b5bab6fe31..0000000000 --- a/core/fxge/include/ifx_systemfontinfo.h +++ /dev/null @@ -1,49 +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_FXGE_INCLUDE_IFX_SYSTEMFONTINFO_H_ -#define CORE_FXGE_INCLUDE_IFX_SYSTEMFONTINFO_H_ - -#include "core/fxge/include/cfx_fontmapper.h" -#include "core/fxge/include/fx_font.h" - -const uint32_t kTableNAME = FXDWORD_GET_MSBFIRST("name"); -const uint32_t kTableTTCF = FXDWORD_GET_MSBFIRST("ttcf"); - -class IFX_SystemFontInfo { - public: - static std::unique_ptr CreateDefault( - const char** pUserPaths); - - virtual ~IFX_SystemFontInfo() {} - - virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0; - virtual void* MapFont(int weight, - FX_BOOL bItalic, - int charset, - int pitch_family, - const FX_CHAR* face, - int& iExact) = 0; - -#ifdef PDF_ENABLE_XFA - virtual void* MapFontByUnicode(uint32_t dwUnicode, - int weight, - FX_BOOL bItalic, - int pitch_family); -#endif // PDF_ENABLE_XFA - - virtual void* GetFont(const FX_CHAR* face) = 0; - virtual uint32_t GetFontData(void* hFont, - uint32_t table, - uint8_t* buffer, - uint32_t size) = 0; - virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) = 0; - virtual FX_BOOL GetFontCharset(void* hFont, int& charset) = 0; - virtual int GetFaceIndex(void* hFont); - virtual void DeleteFont(void* hFont) = 0; -}; - -#endif // CORE_FXGE_INCLUDE_IFX_SYSTEMFONTINFO_H_ diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index be4d57b5c0..6a492dd074 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -14,11 +14,11 @@ #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "core/fxge/skia/fx_skia_device.h" #include "third_party/skia/include/core/SkCanvas.h" diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h index 78d8e32ebc..eb5063aafb 100644 --- a/core/fxge/skia/fx_skia_device.h +++ b/core/fxge/skia/fx_skia_device.h @@ -7,8 +7,8 @@ #if defined(_SKIA_SUPPORT_) -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/ifx_renderdevicedriver.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/ifx_renderdevicedriver.h" class SkCanvas; class SkMatrix; diff --git a/core/fxge/skia/fx_skia_device_unittest.cpp b/core/fxge/skia/fx_skia_device_unittest.cpp index 5666feea9f..4cb459b140 100644 --- a/core/fxge/skia/fx_skia_device_unittest.cpp +++ b/core/fxge/skia/fx_skia_device_unittest.cpp @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "core/fxge/skia/fx_skia_device.h" #include "fpdfsdk/include/fsdk_define.h" #include "public/fpdfview.h" diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index d2aa5ff0ec..8e689240dd 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -20,17 +20,17 @@ #include "core/fxge/agg/fx_agg_driver.h" #endif +#include "core/fxge/cfx_fontmapper.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_windowsdevice.h" #include "core/fxge/dib/dib_int.h" +#include "core/fxge/fx_font.h" +#include "core/fxge/fx_freetype.h" #include "core/fxge/ge/cfx_folderfontinfo.h" #include "core/fxge/ge/fx_text_int.h" -#include "core/fxge/include/cfx_fontmapper.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_windowsdevice.h" -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/fx_freetype.h" -#include "core/fxge/include/ifx_systemfontinfo.h" +#include "core/fxge/ifx_systemfontinfo.h" #include "core/fxge/win32/cfx_windowsdib.h" #include "core/fxge/win32/dwrite_int.h" #include "core/fxge/win32/win32_int.h" diff --git a/core/fxge/win32/fx_win32_dib.cpp b/core/fxge/win32/fx_win32_dib.cpp index 7ab64ca961..cd48ad25b5 100644 --- a/core/fxge/win32/fx_win32_dib.cpp +++ b/core/fxge/win32/fx_win32_dib.cpp @@ -9,7 +9,7 @@ #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ #include -#include "core/fxge/include/cfx_gemodule.h" +#include "core/fxge/cfx_gemodule.h" #include "core/fxge/win32/cfx_windowsdib.h" #include "core/fxge/win32/win32_int.h" diff --git a/core/fxge/win32/fx_win32_gdipext.cpp b/core/fxge/win32/fx_win32_gdipext.cpp index 7094da5527..d3135a249c 100644 --- a/core/fxge/win32/fx_win32_gdipext.cpp +++ b/core/fxge/win32/fx_win32_gdipext.cpp @@ -17,9 +17,9 @@ using std::max; #include -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" #include "core/fxge/win32/cfx_windowsdib.h" #include "core/fxge/win32/win32_int.h" diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp index 5372c19e84..b83714d3e0 100644 --- a/core/fxge/win32/fx_win32_print.cpp +++ b/core/fxge/win32/fx_win32_print.cpp @@ -12,11 +12,11 @@ #include +#include "core/fxge/cfx_renderdevice.h" +#include "core/fxge/cfx_windowsdevice.h" #include "core/fxge/dib/dib_int.h" +#include "core/fxge/fx_freetype.h" #include "core/fxge/ge/fx_text_int.h" -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/cfx_windowsdevice.h" -#include "core/fxge/include/fx_freetype.h" #include "core/fxge/win32/win32_int.h" #if defined(PDFIUM_PRINT_TEXT_WITH_GDI) diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h index 7e35793675..0cea52b908 100644 --- a/core/fxge/win32/win32_int.h +++ b/core/fxge/win32/win32_int.h @@ -7,8 +7,8 @@ #ifndef CORE_FXGE_WIN32_WIN32_INT_H_ #define CORE_FXGE_WIN32_WIN32_INT_H_ -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/ifx_renderdevicedriver.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/ifx_renderdevicedriver.h" #include "core/fxge/win32/dwrite_int.h" struct FXTEXT_CHARPOS; diff --git a/fpdfsdk/DEPS b/fpdfsdk/DEPS index d01574dd3f..0fed7f3228 100644 --- a/fpdfsdk/DEPS +++ b/fpdfsdk/DEPS @@ -8,7 +8,7 @@ include_rules = [ '+core/fpdfdoc', '+core/fxcodec', '+core/fxcrt', - '+core/fxge/include', + '+core/fxge', '+public', '+v8', '+xfa/fwl/core/include', diff --git a/fpdfsdk/cfx_systemhandler.cpp b/fpdfsdk/cfx_systemhandler.cpp index c7d81d5259..03a737459f 100644 --- a/fpdfsdk/cfx_systemhandler.cpp +++ b/fpdfsdk/cfx_systemhandler.cpp @@ -9,9 +9,9 @@ #include #include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fxge/include/cfx_fontmapper.h" -#include "core/fxge/include/cfx_fontmgr.h" -#include "core/fxge/include/cfx_gemodule.h" +#include "core/fxge/cfx_fontmapper.h" +#include "core/fxge/cfx_fontmgr.h" +#include "core/fxge/cfx_gemodule.h" #include "fpdfsdk/formfiller/cffl_formfiller.h" #include "fpdfsdk/include/cpdfsdk_annot.h" #include "fpdfsdk/include/cpdfsdk_document.h" diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp index 9afd30b57b..eb257cc581 100644 --- a/fpdfsdk/cpdfsdk_interform.cpp +++ b/fpdfsdk/cpdfsdk_interform.cpp @@ -17,9 +17,9 @@ #include "core/fpdfapi/fpdf_parser/cpdf_stream.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" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "fpdfsdk/formfiller/cffl_formfiller.h" #include "fpdfsdk/fxedit/include/fxet_edit.h" #include "fpdfsdk/include/cba_annotiterator.h" diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp index 284fe8a762..d41f8927d7 100644 --- a/fpdfsdk/cpdfsdk_widget.cpp +++ b/fpdfsdk/cpdfsdk_widget.cpp @@ -16,9 +16,9 @@ #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" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "fpdfsdk/formfiller/cba_fontmap.h" #include "fpdfsdk/fxedit/include/fxet_edit.h" #include "fpdfsdk/include/cpdfsdk_document.h" diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp index 60e17a3ae8..43932a3afd 100644 --- a/fpdfsdk/formfiller/cba_fontmap.cpp +++ b/fpdfsdk/formfiller/cba_fontmap.cpp @@ -13,7 +13,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" #include "core/fpdfdoc/cpdf_formfield.h" -#include "core/fxge/include/cfx_substfont.h" +#include "core/fxge/cfx_substfont.h" #include "fpdfsdk/include/cpdfsdk_annot.h" CBA_FontMap::CBA_FontMap(CPDFSDK_Annot* pAnnot, diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp index 64a76366f9..ca3c8f0acd 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.cpp +++ b/fpdfsdk/formfiller/cffl_formfiller.cpp @@ -7,7 +7,7 @@ #include "fpdfsdk/formfiller/cffl_formfiller.h" #include "core/fpdfapi/fpdf_page/cpdf_page.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_renderdevice.h" #include "fpdfsdk/formfiller/cba_fontmap.h" #include "fpdfsdk/include/cpdfsdk_document.h" #include "fpdfsdk/include/cpdfsdk_environment.h" diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp index 1289becd7f..dd30b8ecf2 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp @@ -8,9 +8,9 @@ #include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "fpdfsdk/formfiller/cffl_checkbox.h" #include "fpdfsdk/formfiller/cffl_combobox.h" #include "fpdfsdk/formfiller/cffl_formfiller.h" diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp index 4722a9f0bc..70eff8b4e2 100644 --- a/fpdfsdk/fpdf_progressive.cpp +++ b/fpdfsdk/fpdf_progressive.cpp @@ -10,8 +10,8 @@ #include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_render/cpdf_progressiverenderer.h" #include "core/fxcrt/fx_memory.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_renderdevice.h" #include "fpdfsdk/include/fsdk_define.h" #include "fpdfsdk/include/fsdk_pauseadapter.h" #include "public/fpdfview.h" diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp index c5eab95d56..a50a8ba312 100644 --- a/fpdfsdk/fpdf_sysfontinfo.cpp +++ b/fpdfsdk/fpdf_sysfontinfo.cpp @@ -6,10 +6,10 @@ #include "public/fpdf_sysfontinfo.h" -#include "core/fxge/include/cfx_fontmapper.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/fx_font.h" -#include "core/fxge/include/ifx_systemfontinfo.h" +#include "core/fxge/cfx_fontmapper.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/fx_font.h" +#include "core/fxge/ifx_systemfontinfo.h" #include "fpdfsdk/include/fsdk_define.h" #include "fpdfsdk/pdfwindow/PWL_FontMap.h" diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp index 4fb0a50e20..dfc0ea028f 100644 --- a/fpdfsdk/fpdf_transformpage.cpp +++ b/fpdfsdk/fpdf_transformpage.cpp @@ -15,7 +15,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_number.h" #include "core/fpdfapi/fpdf_parser/cpdf_reference.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" -#include "core/fxge/include/cfx_pathdata.h" +#include "core/fxge/cfx_pathdata.h" #include "fpdfsdk/include/fsdk_define.h" namespace { diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp index 11d4467854..dfa63da491 100644 --- a/fpdfsdk/fpdfformfill.cpp +++ b/fpdfsdk/fpdfformfill.cpp @@ -16,7 +16,7 @@ #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 "core/fxge/cfx_fxgedevice.h" #include "fpdfsdk/include/cpdfsdk_document.h" #include "fpdfsdk/include/cpdfsdk_environment.h" #include "fpdfsdk/include/cpdfsdk_interform.h" diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 5f115f2db5..50831d6d2e 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -24,8 +24,8 @@ #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_memory.h" #include "core/fxcrt/fx_safe_types.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_gemodule.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_gemodule.h" #include "fpdfsdk/include/cpdfsdk_pageview.h" #include "fpdfsdk/include/fsdk_define.h" #include "fpdfsdk/include/fsdk_pauseadapter.h" @@ -43,7 +43,7 @@ #endif // PDF_ENABLE_XFA #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ -#include "core/fxge/include/cfx_windowsdevice.h" +#include "core/fxge/cfx_windowsdevice.h" #endif UnderlyingDocumentType* UnderlyingFromFPDFDocument(FPDF_DOCUMENT doc) { diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp index db299e5bf7..bed91dc98c 100644 --- a/fpdfsdk/fxedit/fxet_edit.cpp +++ b/fpdfsdk/fxedit/fxet_edit.cpp @@ -21,9 +21,9 @@ #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" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "fpdfsdk/cfx_systemhandler.h" #include "fpdfsdk/fxedit/include/fx_edit.h" #include "fpdfsdk/pdfwindow/PWL_Edit.h" diff --git a/fpdfsdk/include/cpdfsdk_interform.h b/fpdfsdk/include/cpdfsdk_interform.h index 6bea3cfac0..133fe90341 100644 --- a/fpdfsdk/include/cpdfsdk_interform.h +++ b/fpdfsdk/include/cpdfsdk_interform.h @@ -13,7 +13,7 @@ #include "core/fpdfdoc/cpdf_action.h" #include "core/fpdfdoc/ipdf_formnotify.h" #include "core/fxcrt/fx_basic.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" class CPDF_Dictionary; class CPDF_FormControl; diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h index d9c9b46901..ec99dbbf50 100644 --- a/fpdfsdk/include/fsdk_define.h +++ b/fpdfsdk/include/fsdk_define.h @@ -8,7 +8,7 @@ #define FPDFSDK_INCLUDE_FSDK_DEFINE_H_ #include "core/fpdfapi/fpdf_parser/cpdf_parser.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "public/fpdfview.h" #ifdef PDF_ENABLE_XFA diff --git a/fpdfsdk/pdfwindow/PWL_Caret.cpp b/fpdfsdk/pdfwindow/PWL_Caret.cpp index 62f424b86e..0965ce10d0 100644 --- a/fpdfsdk/pdfwindow/PWL_Caret.cpp +++ b/fpdfsdk/pdfwindow/PWL_Caret.cpp @@ -6,9 +6,9 @@ #include "fpdfsdk/pdfwindow/PWL_Caret.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "fpdfsdk/pdfwindow/PWL_Utils.h" #include "fpdfsdk/pdfwindow/PWL_Wnd.h" diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp index c02b268d14..ad390766c5 100644 --- a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp +++ b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp @@ -6,8 +6,8 @@ #include "fpdfsdk/pdfwindow/PWL_ComboBox.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "fpdfsdk/fxedit/include/fxet_list.h" #include "fpdfsdk/pdfwindow/PWL_Edit.h" #include "fpdfsdk/pdfwindow/PWL_EditCtrl.h" diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp index 8c02607719..c5e928771e 100644 --- a/fpdfsdk/pdfwindow/PWL_Edit.cpp +++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp @@ -12,10 +12,10 @@ #include "core/fpdfdoc/cpvt_word.h" #include "core/fxcrt/fx_safe_types.h" #include "core/fxcrt/fx_xml.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/fx_font.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" +#include "core/fxge/fx_font.h" #include "fpdfsdk/fxedit/include/fxet_edit.h" #include "fpdfsdk/pdfwindow/PWL_Caret.h" #include "fpdfsdk/pdfwindow/PWL_EditCtrl.h" diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp index c99af4d155..8452febb97 100644 --- a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp +++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp @@ -8,7 +8,7 @@ #include "core/fpdfdoc/cpvt_section.h" #include "core/fpdfdoc/cpvt_word.h" -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_font.h" #include "fpdfsdk/fxedit/include/fxet_edit.h" #include "fpdfsdk/pdfwindow/PWL_Caret.h" #include "fpdfsdk/pdfwindow/PWL_FontMap.h" diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.h b/fpdfsdk/pdfwindow/PWL_FontMap.h index 3dcd33919f..5acba9882a 100644 --- a/fpdfsdk/pdfwindow/PWL_FontMap.h +++ b/fpdfsdk/pdfwindow/PWL_FontMap.h @@ -10,7 +10,7 @@ #include #include "core/fpdfdoc/ipvt_fontmap.h" -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_font.h" #include "fpdfsdk/fxedit/include/fx_edit.h" #include "public/fpdf_sysfontinfo.h" diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp index 17f62f58d6..684f6c337c 100644 --- a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp +++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp @@ -6,8 +6,8 @@ #include "fpdfsdk/pdfwindow/PWL_ScrollBar.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "fpdfsdk/pdfwindow/PWL_Utils.h" #include "fpdfsdk/pdfwindow/PWL_Wnd.h" diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp index 4b19fd5927..6503fc60db 100644 --- a/fpdfsdk/pdfwindow/PWL_Utils.cpp +++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp @@ -9,9 +9,9 @@ #include #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" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "fpdfsdk/fxedit/include/fxet_edit.h" #include "fpdfsdk/pdfwindow/PWL_Icon.h" #include "fpdfsdk/pdfwindow/PWL_Wnd.h" diff --git a/xfa/DEPS b/xfa/DEPS index fc47df481c..02e836ef76 100644 --- a/xfa/DEPS +++ b/xfa/DEPS @@ -1,6 +1,6 @@ include_rules = [ '+core/fxcrt', '+core/fpdfapi/fpdf_parser', - '+core/fxge/include', + '+core/fxge', '+third_party/bigint' ] diff --git a/xfa/fde/cfde_path.h b/xfa/fde/cfde_path.h index 54bebf3bc8..34619d45ef 100644 --- a/xfa/fde/cfde_path.h +++ b/xfa/fde/cfde_path.h @@ -7,8 +7,8 @@ #ifndef XFA_FDE_CFDE_PATH_H_ #define XFA_FDE_CFDE_PATH_H_ -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "xfa/fgas/crt/fgas_memory.h" class CFDE_Path : public CFX_Target { diff --git a/xfa/fde/css/fde_css.h b/xfa/fde/css/fde_css.h index 74a0ef609a..5b033cf014 100644 --- a/xfa/fde/css/fde_css.h +++ b/xfa/fde/css/fde_css.h @@ -7,7 +7,7 @@ #ifndef XFA_FDE_CSS_FDE_CSS_H_ #define XFA_FDE_CSS_FDE_CSS_H_ -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fgas/crt/fgas_stream.h" #include "xfa/fgas/crt/fgas_utils.h" #include "xfa/fgas/font/fgas_font.h" diff --git a/xfa/fde/fde_gedevice.cpp b/xfa/fde/fde_gedevice.cpp index 15c849f71f..076e70dedf 100644 --- a/xfa/fde/fde_gedevice.cpp +++ b/xfa/fde/fde_gedevice.cpp @@ -8,10 +8,10 @@ #include -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/cfx_substfont.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_renderdevice.h" +#include "core/fxge/cfx_substfont.h" #include "xfa/fde/cfde_path.h" #include "xfa/fde/fde_object.h" #include "xfa/fgas/font/fgas_font.h" diff --git a/xfa/fde/fde_gedevice.h b/xfa/fde/fde_gedevice.h index e3b9208d93..d290f166a8 100644 --- a/xfa/fde/fde_gedevice.h +++ b/xfa/fde/fde_gedevice.h @@ -7,7 +7,7 @@ #ifndef XFA_FDE_FDE_GEDEVICE_H_ #define XFA_FDE_FDE_GEDEVICE_H_ -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_renderdevice.h" #include "xfa/fgas/crt/fgas_memory.h" class CFDE_Brush; diff --git a/xfa/fde/fde_object.h b/xfa/fde/fde_object.h index 2af18ec3b7..bf1ec41dac 100644 --- a/xfa/fde/fde_object.h +++ b/xfa/fde/fde_object.h @@ -9,7 +9,7 @@ #include -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fgas/crt/fgas_memory.h" class CFDE_Brush : public CFX_Target { diff --git a/xfa/fde/fde_visualset.h b/xfa/fde/fde_visualset.h index 45b9391e63..103e7258ca 100644 --- a/xfa/fde/fde_visualset.h +++ b/xfa/fde/fde_visualset.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fde/cfde_path.h" #include "xfa/fde/fde_object.h" #include "xfa/fgas/crt/fgas_memory.h" diff --git a/xfa/fde/ifde_txtedtengine.h b/xfa/fde/ifde_txtedtengine.h index cf760035cf..cb9ec559e3 100644 --- a/xfa/fde/ifde_txtedtengine.h +++ b/xfa/fde/ifde_txtedtengine.h @@ -7,7 +7,7 @@ #ifndef XFA_FDE_IFDE_TXTEDTENGINE_H_ #define XFA_FDE_IFDE_TXTEDTENGINE_H_ -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fgas/font/fgas_font.h" class CFDE_TxtEdtEngine; diff --git a/xfa/fde/tto/fde_textout.h b/xfa/fde/tto/fde_textout.h index 6ce32d2fe8..341547185c 100644 --- a/xfa/fde/tto/fde_textout.h +++ b/xfa/fde/tto/fde_textout.h @@ -10,9 +10,9 @@ #include #include -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_renderdevice.h" +#include "core/fxge/fx_dib.h" #include "xfa/fde/fde_object.h" #include "xfa/fgas/crt/fgas_utils.h" #include "xfa/fgas/font/fgas_font.h" diff --git a/xfa/fgas/font/fgas_font.h b/xfa/fgas/font/fgas_font.h index f91c015dae..07bfc1daea 100644 --- a/xfa/fgas/font/fgas_font.h +++ b/xfa/fgas/font/fgas_font.h @@ -7,7 +7,7 @@ #ifndef XFA_FGAS_FONT_FGAS_FONT_H_ #define XFA_FGAS_FONT_FGAS_FONT_H_ -#include "core/fxge/include/fx_font.h" +#include "core/fxge/fx_font.h" #include "xfa/fgas/crt/fgas_stream.h" #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ diff --git a/xfa/fgas/font/fgas_gefont.cpp b/xfa/fgas/font/fgas_gefont.cpp index c272f9160d..08cb80e1ef 100644 --- a/xfa/fgas/font/fgas_gefont.cpp +++ b/xfa/fgas/font/fgas_gefont.cpp @@ -9,9 +9,9 @@ #include #include -#include "core/fxge/include/cfx_substfont.h" -#include "core/fxge/include/cfx_unicodeencoding.h" -#include "core/fxge/include/cfx_unicodeencodingex.h" +#include "core/fxge/cfx_substfont.h" +#include "core/fxge/cfx_unicodeencoding.h" +#include "core/fxge/cfx_unicodeencodingex.h" #include "xfa/fgas/crt/fgas_codepage.h" #include "xfa/fgas/font/fgas_fontutils.h" #include "xfa/fxfa/include/xfa_fontmgr.h" diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp index 93f1a7a436..de72628760 100644 --- a/xfa/fgas/font/fgas_stdfontmgr.cpp +++ b/xfa/fgas/font/fgas_stdfontmgr.cpp @@ -7,10 +7,10 @@ #include "xfa/fgas/font/fgas_stdfontmgr.h" #include "core/fxcrt/fx_stream.h" -#include "core/fxge/include/cfx_fontmapper.h" -#include "core/fxge/include/cfx_fontmgr.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/ifx_systemfontinfo.h" +#include "core/fxge/cfx_fontmapper.h" +#include "core/fxge/cfx_fontmgr.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/ifx_systemfontinfo.h" #include "xfa/fgas/crt/fgas_codepage.h" #include "xfa/fgas/font/fgas_fontutils.h" #include "xfa/fgas/font/fgas_gefont.h" diff --git a/xfa/fgas/font/fgas_stdfontmgr.h b/xfa/fgas/font/fgas_stdfontmgr.h index f2d87b9002..9d5cb68070 100644 --- a/xfa/fgas/font/fgas_stdfontmgr.h +++ b/xfa/fgas/font/fgas_stdfontmgr.h @@ -10,9 +10,9 @@ #include #include "core/fxcrt/fx_ext.h" -#include "core/fxge/include/cfx_fontmapper.h" -#include "core/fxge/include/fx_freetype.h" -#include "core/fxge/include/ifx_systemfontinfo.h" +#include "core/fxge/cfx_fontmapper.h" +#include "core/fxge/fx_freetype.h" +#include "core/fxge/ifx_systemfontinfo.h" #include "third_party/freetype/include/freetype/fttypes.h" #include "xfa/fgas/font/fgas_font.h" diff --git a/xfa/fgas/layout/fgas_textbreak.h b/xfa/fgas/layout/fgas_textbreak.h index 062646f8b4..d8464ab0cb 100644 --- a/xfa/fgas/layout/fgas_textbreak.h +++ b/xfa/fgas/layout/fgas_textbreak.h @@ -10,7 +10,7 @@ #include #include "core/fxcrt/fx_ucd.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_renderdevice.h" #include "xfa/fgas/crt/fgas_utils.h" #include "xfa/fgas/layout/fgas_unicode.h" diff --git a/xfa/fwl/basewidget/cfx_barcode.h b/xfa/fwl/basewidget/cfx_barcode.h index 7665476780..da2aabf575 100644 --- a/xfa/fwl/basewidget/cfx_barcode.h +++ b/xfa/fwl/basewidget/cfx_barcode.h @@ -12,7 +12,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxbarcode/include/BC_Library.h" class CBC_CodeBase; diff --git a/xfa/fwl/core/cfwl_themebackground.h b/xfa/fwl/core/cfwl_themebackground.h index 9761183011..54d58b38f6 100644 --- a/xfa/fwl/core/cfwl_themebackground.h +++ b/xfa/fwl/core/cfwl_themebackground.h @@ -7,7 +7,7 @@ #ifndef XFA_FWL_CORE_CFWL_THEMEBACKGROUND_H_ #define XFA_FWL_CORE_CFWL_THEMEBACKGROUND_H_ -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fwl/core/cfwl_themepart.h" class CFX_DIBitmpa; diff --git a/xfa/fwl/theme/cfwl_arrowdata.h b/xfa/fwl/theme/cfwl_arrowdata.h index e549c157e5..efec1b50b1 100644 --- a/xfa/fwl/theme/cfwl_arrowdata.h +++ b/xfa/fwl/theme/cfwl_arrowdata.h @@ -10,7 +10,7 @@ #include #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" class CFWL_ArrowData { public: diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp index 45b0154bd6..033ee14ef3 100644 --- a/xfa/fwl/theme/cfwl_checkboxtp.cpp +++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp @@ -6,7 +6,7 @@ #include "xfa/fwl/theme/cfwl_checkboxtp.h" -#include "core/fxge/include/cfx_pathdata.h" +#include "core/fxge/cfx_pathdata.h" #include "xfa/fde/tto/fde_textout.h" #include "xfa/fwl/basewidget/ifwl_checkbox.h" #include "xfa/fwl/core/cfwl_themebackground.h" diff --git a/xfa/fxbarcode/BC_TwoDimWriter.cpp b/xfa/fxbarcode/BC_TwoDimWriter.cpp index cda0467fe1..2ad60bbde3 100644 --- a/xfa/fxbarcode/BC_TwoDimWriter.cpp +++ b/xfa/fxbarcode/BC_TwoDimWriter.cpp @@ -6,9 +6,9 @@ #include -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "third_party/base/numerics/safe_math.h" #include "xfa/fxbarcode/BC_TwoDimWriter.h" #include "xfa/fxbarcode/BC_Writer.h" diff --git a/xfa/fxbarcode/BC_Writer.h b/xfa/fxbarcode/BC_Writer.h index 8e4eaf1f5e..888db560ae 100644 --- a/xfa/fxbarcode/BC_Writer.h +++ b/xfa/fxbarcode/BC_Writer.h @@ -8,7 +8,7 @@ #define XFA_FXBARCODE_BC_WRITER_H_ #include "core/fxcrt/fx_string.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxbarcode/utils.h" class CBC_Writer { diff --git a/xfa/fxbarcode/cbc_codabar.h b/xfa/fxbarcode/cbc_codabar.h index b0a587b2d9..2a4ee79e68 100644 --- a/xfa/fxbarcode/cbc_codabar.h +++ b/xfa/fxbarcode/cbc_codabar.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxbarcode/cbc_onecode.h" class CBC_Codabar : public CBC_OneCode { diff --git a/xfa/fxbarcode/cbc_code128.h b/xfa/fxbarcode/cbc_code128.h index 2088bdd714..4404f6c1e3 100644 --- a/xfa/fxbarcode/cbc_code128.h +++ b/xfa/fxbarcode/cbc_code128.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxbarcode/cbc_onecode.h" class CBC_Code128 : public CBC_OneCode { diff --git a/xfa/fxbarcode/cbc_code39.h b/xfa/fxbarcode/cbc_code39.h index 51f1759ca0..42edf8e35f 100644 --- a/xfa/fxbarcode/cbc_code39.h +++ b/xfa/fxbarcode/cbc_code39.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxbarcode/cbc_onecode.h" class CBC_Code39 : public CBC_OneCode { diff --git a/xfa/fxbarcode/cbc_codebase.h b/xfa/fxbarcode/cbc_codebase.h index a6448db741..d185d0ead2 100644 --- a/xfa/fxbarcode/cbc_codebase.h +++ b/xfa/fxbarcode/cbc_codebase.h @@ -10,7 +10,7 @@ #include #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxbarcode/include/BC_Library.h" class CBC_Writer; diff --git a/xfa/fxbarcode/cbc_datamatrix.h b/xfa/fxbarcode/cbc_datamatrix.h index 51d7c3d3f9..df2e5ad241 100644 --- a/xfa/fxbarcode/cbc_datamatrix.h +++ b/xfa/fxbarcode/cbc_datamatrix.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxbarcode/cbc_codebase.h" class CBC_DataMatrix : public CBC_CodeBase { diff --git a/xfa/fxbarcode/cbc_ean13.h b/xfa/fxbarcode/cbc_ean13.h index fae8c50915..d42c2fdbc1 100644 --- a/xfa/fxbarcode/cbc_ean13.h +++ b/xfa/fxbarcode/cbc_ean13.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxbarcode/cbc_onecode.h" class CBC_EAN13 : public CBC_OneCode { diff --git a/xfa/fxbarcode/cbc_ean8.h b/xfa/fxbarcode/cbc_ean8.h index c345af3a9c..ffd06e51d5 100644 --- a/xfa/fxbarcode/cbc_ean8.h +++ b/xfa/fxbarcode/cbc_ean8.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxbarcode/cbc_onecode.h" class CBC_EAN8 : public CBC_OneCode { diff --git a/xfa/fxbarcode/cbc_pdf417i.h b/xfa/fxbarcode/cbc_pdf417i.h index ca6ac11b26..6067282de8 100644 --- a/xfa/fxbarcode/cbc_pdf417i.h +++ b/xfa/fxbarcode/cbc_pdf417i.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxbarcode/cbc_codebase.h" class CBC_PDF417I : public CBC_CodeBase { diff --git a/xfa/fxbarcode/cbc_qrcode.h b/xfa/fxbarcode/cbc_qrcode.h index e8c9ced56e..e3b554b109 100644 --- a/xfa/fxbarcode/cbc_qrcode.h +++ b/xfa/fxbarcode/cbc_qrcode.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxbarcode/cbc_codebase.h" class CBC_QRCode : public CBC_CodeBase { diff --git a/xfa/fxbarcode/cbc_upca.h b/xfa/fxbarcode/cbc_upca.h index 7e869b6ace..11769f361e 100644 --- a/xfa/fxbarcode/cbc_upca.h +++ b/xfa/fxbarcode/cbc_upca.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxbarcode/cbc_onecode.h" class CBC_UPCA : public CBC_OneCode { diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp index 80f76fba9f..72c956ac11 100644 --- a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp +++ b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp @@ -25,12 +25,12 @@ #include #include -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/cfx_unicodeencodingex.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" +#include "core/fxge/cfx_unicodeencodingex.h" #include "xfa/fxbarcode/BC_Writer.h" #include "xfa/fxbarcode/common/BC_CommonBitMatrix.h" diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.h b/xfa/fxbarcode/oned/BC_OneDimWriter.h index 91763a90a8..910b2068c8 100644 --- a/xfa/fxbarcode/oned/BC_OneDimWriter.h +++ b/xfa/fxbarcode/oned/BC_OneDimWriter.h @@ -9,7 +9,7 @@ #include -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_renderdevice.h" #include "xfa/fxbarcode/BC_Writer.h" #include "xfa/fxbarcode/include/BC_Library.h" diff --git a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp index 632738779a..51f77b5082 100644 --- a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp +++ b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp @@ -20,8 +20,8 @@ * limitations under the License. */ -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_gemodule.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_gemodule.h" #include "xfa/fxbarcode/BC_Writer.h" #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" #include "xfa/fxbarcode/oned/BC_OnedEAN13Writer.h" diff --git a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp index fb95f264a0..2305b18a90 100644 --- a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp +++ b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp @@ -20,8 +20,8 @@ * limitations under the License. */ -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_gemodule.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_gemodule.h" #include "xfa/fxbarcode/BC_Writer.h" #include "xfa/fxbarcode/common/BC_CommonBitMatrix.h" #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp index 12acb5280b..e594bc7ee6 100644 --- a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp +++ b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp @@ -20,8 +20,8 @@ * limitations under the License. */ -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_gemodule.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_gemodule.h" #include "xfa/fxbarcode/BC_Writer.h" #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" #include "xfa/fxbarcode/oned/BC_OnedEAN13Writer.h" diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp index 31cbf25928..10b587004d 100644 --- a/xfa/fxfa/app/xfa_ffwidget.cpp +++ b/xfa/fxfa/app/xfa_ffwidget.cpp @@ -12,9 +12,9 @@ #include "core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h" #include "core/fxcodec/codec/ccodec_progressivedecoder.h" #include "core/fxcodec/fx_codec.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" #include "xfa/fxfa/app/xfa_textlayout.h" #include "xfa/fxfa/include/cxfa_eventparam.h" #include "xfa/fxfa/include/fxfa_widget.h" diff --git a/xfa/fxfa/include/fxfa_widget.h b/xfa/fxfa/include/fxfa_widget.h index 9bab36f806..07b25ef5ab 100644 --- a/xfa/fxfa/include/fxfa_widget.h +++ b/xfa/fxfa/include/fxfa_widget.h @@ -8,7 +8,7 @@ #define XFA_FXFA_INCLUDE_FXFA_WIDGET_H_ #include "core/fxcrt/fx_coordinates.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxfa/parser/cxfa_box.h" #include "xfa/fxfa/parser/cxfa_event.h" #include "xfa/fxfa/parser/cxfa_image.h" diff --git a/xfa/fxfa/include/xfa_ffwidget.h b/xfa/fxfa/include/xfa_ffwidget.h index 7b6130f09b..a44dd783b5 100644 --- a/xfa/fxfa/include/xfa_ffwidget.h +++ b/xfa/fxfa/include/xfa_ffwidget.h @@ -10,7 +10,7 @@ #include #include "core/fxcodec/fx_codec_def.h" -#include "core/fxge/include/cfx_graphstatedata.h" +#include "core/fxge/cfx_graphstatedata.h" #include "xfa/fxfa/include/fxfa.h" #include "xfa/fxfa/parser/cxfa_contentlayoutitem.h" diff --git a/xfa/fxfa/parser/cxfa_data.h b/xfa/fxfa/parser/cxfa_data.h index 8432cf4a29..e3c6390d80 100644 --- a/xfa/fxfa/parser/cxfa_data.h +++ b/xfa/fxfa/parser/cxfa_data.h @@ -8,7 +8,7 @@ #define XFA_FXFA_PARSER_CXFA_DATA_H_ #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxfa/include/fxfa_basic.h" class CXFA_Node; diff --git a/xfa/fxfa/parser/cxfa_fill.h b/xfa/fxfa/parser/cxfa_fill.h index 70b0886c85..2a5f673aa0 100644 --- a/xfa/fxfa/parser/cxfa_fill.h +++ b/xfa/fxfa/parser/cxfa_fill.h @@ -8,7 +8,7 @@ #define XFA_FXFA_PARSER_CXFA_FILL_H_ #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxfa/parser/cxfa_data.h" class CXFA_Node; diff --git a/xfa/fxfa/parser/cxfa_font.cpp b/xfa/fxfa/parser/cxfa_font.cpp index 52d12bb024..2dcb405141 100644 --- a/xfa/fxfa/parser/cxfa_font.cpp +++ b/xfa/fxfa/parser/cxfa_font.cpp @@ -6,7 +6,7 @@ #include "xfa/fxfa/parser/cxfa_font.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxfa/parser/cxfa_fill.h" #include "xfa/fxfa/parser/cxfa_measurement.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxfa/parser/cxfa_font.h b/xfa/fxfa/parser/cxfa_font.h index e2e1809aa3..0151dfbe5f 100644 --- a/xfa/fxfa/parser/cxfa_font.h +++ b/xfa/fxfa/parser/cxfa_font.h @@ -7,7 +7,7 @@ #ifndef XFA_FXFA_PARSER_CXFA_FONT_H_ #define XFA_FXFA_PARSER_CXFA_FONT_H_ -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxfa/parser/cxfa_data.h" class CXFA_Node; diff --git a/xfa/fxfa/parser/cxfa_stroke.h b/xfa/fxfa/parser/cxfa_stroke.h index 7d817e0fea..8db1b29959 100644 --- a/xfa/fxfa/parser/cxfa_stroke.h +++ b/xfa/fxfa/parser/cxfa_stroke.h @@ -8,7 +8,7 @@ #define XFA_FXFA_PARSER_CXFA_STROKE_H_ #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxfa/include/fxfa_basic.h" #include "xfa/fxfa/parser/cxfa_data.h" diff --git a/xfa/fxfa/parser/xfa_localemgr.cpp b/xfa/fxfa/parser/xfa_localemgr.cpp index 0bcfe0b5e0..b7f0fbea59 100644 --- a/xfa/fxfa/parser/xfa_localemgr.cpp +++ b/xfa/fxfa/parser/xfa_localemgr.cpp @@ -11,7 +11,7 @@ #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_xml.h" -#include "core/fxge/include/cfx_gemodule.h" +#include "core/fxge/cfx_gemodule.h" #include "xfa/fxfa/parser/cxfa_document.h" #include "xfa/fxfa/parser/xfa_locale.h" #include "xfa/fxfa/parser/xfa_object.h" diff --git a/xfa/fxgraphics/cagg_graphics.h b/xfa/fxgraphics/cagg_graphics.h index 5f53c73695..30117e86c7 100644 --- a/xfa/fxgraphics/cagg_graphics.h +++ b/xfa/fxgraphics/cagg_graphics.h @@ -7,7 +7,7 @@ #ifndef XFA_FXGRAPHICS_CAGG_GRAPHICS_H_ #define XFA_FXGRAPHICS_CAGG_GRAPHICS_H_ -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxgraphics/include/cfx_graphics.h" class CFX_Graphics; diff --git a/xfa/fxgraphics/cfx_color.h b/xfa/fxgraphics/cfx_color.h index 0f321764f9..6af1f37d70 100644 --- a/xfa/fxgraphics/cfx_color.h +++ b/xfa/fxgraphics/cfx_color.h @@ -7,7 +7,7 @@ #ifndef XFA_FXGRAPHICS_CFX_COLOR_H_ #define XFA_FXGRAPHICS_CFX_COLOR_H_ -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #include "xfa/fxgraphics/include/cfx_graphics.h" class CFX_Pattern; diff --git a/xfa/fxgraphics/cfx_graphics.cpp b/xfa/fxgraphics/cfx_graphics.cpp index b9f8287ae4..85a9f439d8 100644 --- a/xfa/fxgraphics/cfx_graphics.cpp +++ b/xfa/fxgraphics/cfx_graphics.cpp @@ -8,10 +8,10 @@ #include -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_gemodule.h" -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/cfx_unicodeencoding.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_gemodule.h" +#include "core/fxge/cfx_renderdevice.h" +#include "core/fxge/cfx_unicodeencoding.h" #include "xfa/fxgraphics/cagg_graphics.h" #include "xfa/fxgraphics/cfx_color.h" #include "xfa/fxgraphics/cfx_path.h" diff --git a/xfa/fxgraphics/cfx_path.cpp b/xfa/fxgraphics/cfx_path.cpp index 5adeded977..e4fb727092 100644 --- a/xfa/fxgraphics/cfx_path.cpp +++ b/xfa/fxgraphics/cfx_path.cpp @@ -6,7 +6,7 @@ #include "xfa/fxgraphics/cfx_path.h" -#include "core/fxge/include/cfx_pathdata.h" +#include "core/fxge/cfx_pathdata.h" #include "xfa/fxgraphics/cfx_path_generator.h" CFX_Path::CFX_Path() {} diff --git a/xfa/fxgraphics/cfx_path_generator.cpp b/xfa/fxgraphics/cfx_path_generator.cpp index 2af39c49d7..b5843ed998 100644 --- a/xfa/fxgraphics/cfx_path_generator.cpp +++ b/xfa/fxgraphics/cfx_path_generator.cpp @@ -6,8 +6,8 @@ #include "xfa/fxgraphics/cfx_path_generator.h" -#include "core/fxge/include/cfx_pathdata.h" -#include "core/fxge/include/cfx_renderdevice.h" +#include "core/fxge/cfx_pathdata.h" +#include "core/fxge/cfx_renderdevice.h" CFX_PathGenerator::CFX_PathGenerator() : m_pPathData(new CFX_PathData) {} diff --git a/xfa/fxgraphics/cfx_path_generator.h b/xfa/fxgraphics/cfx_path_generator.h index aa17a7e323..75e3a57633 100644 --- a/xfa/fxgraphics/cfx_path_generator.h +++ b/xfa/fxgraphics/cfx_path_generator.h @@ -9,7 +9,7 @@ #include -#include "core/fxge/include/cfx_pathdata.h" +#include "core/fxge/cfx_pathdata.h" class CFX_PathGenerator { public: diff --git a/xfa/fxgraphics/cfx_shading.h b/xfa/fxgraphics/cfx_shading.h index eb01112bc5..2cc37cf0f6 100644 --- a/xfa/fxgraphics/cfx_shading.h +++ b/xfa/fxgraphics/cfx_shading.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/fx_dib.h" +#include "core/fxge/fx_dib.h" #define FX_SHADING_Steps 256 diff --git a/xfa/fxgraphics/include/cfx_graphics.h b/xfa/fxgraphics/include/cfx_graphics.h index 3d818d7952..584a5cbac3 100644 --- a/xfa/fxgraphics/include/cfx_graphics.h +++ b/xfa/fxgraphics/include/cfx_graphics.h @@ -10,11 +10,11 @@ #include #include "core/fxcrt/fx_system.h" -#include "core/fxge/include/cfx_fxgedevice.h" -#include "core/fxge/include/cfx_graphstatedata.h" -#include "core/fxge/include/cfx_renderdevice.h" -#include "core/fxge/include/fx_dib.h" -#include "core/fxge/include/fx_font.h" +#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_renderdevice.h" +#include "core/fxge/fx_dib.h" +#include "core/fxge/fx_font.h" #include "xfa/fwl/core/fwl_error.h" class CFX_Color; -- cgit v1.2.3