summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-09 13:49:00 -0500
committerDan Sinclair <dsinclair@chromium.org>2016-03-09 13:49:00 -0500
commit9332e0c2fced598a632e3bbe905b6f63b1f5b06b (patch)
treea8957a09cb34ecd28afcd6ebbed309d9c60e4644
parent8388037a5c58d60043b11c03a8efe78c54c65a4b (diff)
downloadpdfium-9332e0c2fced598a632e3bbe905b6f63b1f5b06b.tar.xz
Cleanup the xfa/src/fgas directory.
This CL moves the code from xfa/src/fgas/src up one level. It then takes the headers in xfa/src/fgas/include and moves them to their correct folder. The src/ and include/ directories are then removed. In some cases, when moving from include/ there was another header with the same name. Those headers were either folded together, or the content of the conflicting folder moved to an anonymous namespace in the cpp file as they were not used anywhere else. Files with duplicate names as core/src/crt were renamed to be fgas_ instead of fx_. (e.g. fgas_system.h, fgas_memory.h, fgas_stream.h) R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1776303002 .
-rw-r--r--BUILD.gn84
-rw-r--r--xfa.gyp84
-rw-r--r--xfa/src/fdp/include/fde_css.h6
-rw-r--r--xfa/src/fdp/include/fde_img.h6
-rw-r--r--xfa/src/fdp/include/fde_psr.h2
-rw-r--r--xfa/src/fdp/include/fde_rdv.h2
-rw-r--r--xfa/src/fdp/include/fde_tto.h2
-rw-r--r--xfa/src/fdp/include/fde_xml.h4
-rw-r--r--xfa/src/fdp/src/css/fde_csscache.h2
-rw-r--r--xfa/src/fdp/src/css/fde_cssdatatable.cpp6
-rw-r--r--xfa/src/fdp/src/css/fde_cssdatatable.h2
-rw-r--r--xfa/src/fdp/src/css/fde_cssdeclaration.cpp2
-rw-r--r--xfa/src/fdp/src/css/fde_cssstyleselector.h4
-rw-r--r--xfa/src/fdp/src/css/fde_cssstylesheet.cpp2
-rw-r--r--xfa/src/fdp/src/css/fde_csssyntax.cpp2
-rw-r--r--xfa/src/fdp/src/css/fde_csssyntax.h4
-rw-r--r--xfa/src/fdp/src/fde/fde_gedevice.h2
-rw-r--r--xfa/src/fdp/src/fde/fde_geobject.h2
-rw-r--r--xfa/src/fdp/src/fde/fde_iterator.cpp2
-rw-r--r--xfa/src/fdp/src/fde/fde_iterator.h2
-rw-r--r--xfa/src/fdp/src/fde/fde_object.h2
-rw-r--r--xfa/src/fdp/src/fde/fde_render.h2
-rw-r--r--xfa/src/fdp/src/tto/fde_textout.h8
-rw-r--r--xfa/src/fdp/src/xml/fde_xml_imp.cpp4
-rw-r--r--xfa/src/fdp/src/xml/fde_xml_imp.h4
-rw-r--r--xfa/src/fee/fde_txtedtbuf.h2
-rw-r--r--xfa/src/fee/fde_txtedtpage.h2
-rw-r--r--xfa/src/fee/fde_txtedtparag.cpp2
-rw-r--r--xfa/src/fee/ifde_txtedtengine.h2
-rw-r--r--xfa/src/fee/ifde_txtedtpage.h2
-rw-r--r--xfa/src/fgas/crt/fgas_algorithm.cpp (renamed from xfa/src/fgas/src/crt/fx_algorithm.cpp)2
-rw-r--r--xfa/src/fgas/crt/fgas_algorithm.h (renamed from xfa/src/fgas/include/fx_alg.h)8
-rw-r--r--xfa/src/fgas/crt/fgas_codepage.cpp (renamed from xfa/src/fgas/src/crt/fx_codepage.cpp)4
-rw-r--r--xfa/src/fgas/crt/fgas_codepage.h (renamed from xfa/src/fgas/include/fx_cpg.h)90
-rw-r--r--xfa/src/fgas/crt/fgas_encode.cpp (renamed from xfa/src/fgas/src/crt/fx_encode.cpp)2
-rw-r--r--xfa/src/fgas/crt/fgas_language.h (renamed from xfa/src/fgas/include/fx_lgg.h)6
-rw-r--r--xfa/src/fgas/crt/fgas_memory.cpp (renamed from xfa/src/fgas/src/crt/fx_memory.cpp)130
-rw-r--r--xfa/src/fgas/crt/fgas_memory.h (renamed from xfa/src/fgas/include/fx_mem.h)9
-rw-r--r--xfa/src/fgas/crt/fgas_stream.cpp (renamed from xfa/src/fgas/src/crt/fx_stream.cpp)304
-rw-r--r--xfa/src/fgas/crt/fgas_stream.h (renamed from xfa/src/fgas/include/fx_stm.h)9
-rw-r--r--xfa/src/fgas/crt/fgas_system.cpp (renamed from xfa/src/fgas/src/crt/fx_system.cpp)2
-rw-r--r--xfa/src/fgas/crt/fgas_system.h (renamed from xfa/src/fgas/include/fx_sys.h)6
-rw-r--r--xfa/src/fgas/crt/fgas_utils.cpp (renamed from xfa/src/fgas/src/crt/fx_utils.cpp)5
-rw-r--r--xfa/src/fgas/crt/fgas_utils.h (renamed from xfa/src/fgas/include/fx_utl.h)74
-rw-r--r--xfa/src/fgas/font/fgas_font.h (renamed from xfa/src/fgas/include/fx_fnt.h)12
-rw-r--r--xfa/src/fgas/font/fgas_fontutils.cpp (renamed from xfa/src/fgas/src/font/fx_fontutils.cpp)4
-rw-r--r--xfa/src/fgas/font/fgas_fontutils.h (renamed from xfa/src/fgas/src/font/fx_fontutils.h)6
-rw-r--r--xfa/src/fgas/font/fgas_gefont.cpp (renamed from xfa/src/fgas/src/font/fx_gefont.cpp)6
-rw-r--r--xfa/src/fgas/font/fgas_gefont.h (renamed from xfa/src/fgas/src/font/fx_gefont.h)10
-rw-r--r--xfa/src/fgas/font/fgas_stdfontmgr.cpp (renamed from xfa/src/fgas/src/font/fx_stdfontmgr.cpp)6
-rw-r--r--xfa/src/fgas/font/fgas_stdfontmgr.h (renamed from xfa/src/fgas/src/font/fx_stdfontmgr.h)8
-rw-r--r--xfa/src/fgas/layout/fgas_linebreak.cpp (renamed from xfa/src/fgas/src/layout/fx_linebreak.cpp)3
-rw-r--r--xfa/src/fgas/layout/fgas_linebreak.h (renamed from xfa/src/fgas/include/fx_lbk.h)8
-rw-r--r--xfa/src/fgas/layout/fgas_rtfbreak.cpp (renamed from xfa/src/fgas/src/layout/fx_rtfbreak.cpp)173
-rw-r--r--xfa/src/fgas/layout/fgas_rtfbreak.h (renamed from xfa/src/fgas/include/fx_rbk.h)16
-rw-r--r--xfa/src/fgas/layout/fgas_textbreak.cpp (renamed from xfa/src/fgas/src/layout/fx_textbreak.cpp)169
-rw-r--r--xfa/src/fgas/layout/fgas_textbreak.h (renamed from xfa/src/fgas/include/fx_tbk.h)11
-rw-r--r--xfa/src/fgas/layout/fgas_unicode.cpp (renamed from xfa/src/fgas/src/layout/fx_unicode.cpp)4
-rw-r--r--xfa/src/fgas/layout/fgas_unicode.h (renamed from xfa/src/fgas/include/fx_ucd.h)17
-rw-r--r--xfa/src/fgas/localization/fgas_datetime.cpp (renamed from xfa/src/fgas/src/localization/fx_datetime.cpp)2
-rw-r--r--xfa/src/fgas/localization/fgas_datetime.h (renamed from xfa/src/fgas/include/fx_datetime.h)10
-rw-r--r--xfa/src/fgas/localization/fgas_locale.cpp (renamed from xfa/src/fgas/src/localization/fx_locale.cpp)2
-rw-r--r--xfa/src/fgas/localization/fgas_locale.h (renamed from xfa/src/fgas/include/fx_locale.h)8
-rw-r--r--xfa/src/fgas/localization/fgas_localeimp.h (renamed from xfa/src/fgas/src/localization/fx_localeimp.h)8
-rw-r--r--xfa/src/fgas/localization/fgas_localemgr.cpp (renamed from xfa/src/fgas/src/localization/fx_localemgr.cpp)2
-rw-r--r--xfa/src/fgas/localization/fgas_localemgr.h (renamed from xfa/src/fgas/src/localization/fx_localemgr.h)8
-rw-r--r--xfa/src/fgas/src/crt/fx_memory.h140
-rw-r--r--xfa/src/fgas/src/crt/fx_stream.h310
-rw-r--r--xfa/src/fgas/src/crt/fx_utils.h41
-rw-r--r--xfa/src/fgas/src/layout/fx_rtfbreak.h177
-rw-r--r--xfa/src/fgas/src/layout/fx_textbreak.h174
-rw-r--r--xfa/src/fgas/src/layout/fx_unicode.h20
-rw-r--r--xfa/src/fgas/xml/fgas_sax.h (renamed from xfa/src/fgas/include/fx_sax.h)6
-rw-r--r--xfa/src/fgas/xml/fgas_sax_imp.cpp (renamed from xfa/src/fgas/src/xml/fx_sax_imp.cpp)2
-rw-r--r--xfa/src/fgas/xml/fgas_sax_imp.h (renamed from xfa/src/fgas/src/xml/fx_sax_imp.h)8
-rw-r--r--xfa/src/fwl/basewidget/fwl_monthcalendarimp.h2
-rw-r--r--xfa/src/fxfa/app/xfa_checksum.cpp2
-rw-r--r--xfa/src/fxfa/app/xfa_checksum.h2
-rw-r--r--xfa/src/fxfa/app/xfa_ffapp.h2
-rw-r--r--xfa/src/fxfa/app/xfa_ffdoc.cpp2
-rw-r--r--xfa/src/fxfa/app/xfa_fontmgr.h2
-rw-r--r--xfa/src/fxfa/app/xfa_fwltheme.cpp2
-rw-r--r--xfa/src/fxfa/app/xfa_textlayout.cpp4
-rw-r--r--xfa/src/fxfa/app/xfa_textlayout.h2
-rw-r--r--xfa/src/fxfa/fm2js/xfa_fm2jscontext.cpp2
-rw-r--r--xfa/src/fxfa/parser/xfa_basic_imp.cpp6
-rw-r--r--xfa/src/fxfa/parser/xfa_basic_imp.h2
-rw-r--r--xfa/src/fxfa/parser/xfa_document_serialize.cpp2
-rw-r--r--xfa/src/fxfa/parser/xfa_layout_itemlayout.cpp2
-rw-r--r--xfa/src/fxfa/parser/xfa_locale.h2
-rw-r--r--xfa/src/fxfa/parser/xfa_localemgr.h4
-rw-r--r--xfa/src/fxfa/parser/xfa_object_imp.cpp4
-rw-r--r--xfa/src/fxfa/parser/xfa_parser_imp.cpp2
93 files changed, 1080 insertions, 1240 deletions
diff --git a/BUILD.gn b/BUILD.gn
index d6e3e60d96..e238d31714 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -894,51 +894,45 @@ if (pdf_enable_xfa) {
"xfa/src/fee/ifde_txtedtbuf.h",
"xfa/src/fee/ifde_txtedtengine.h",
"xfa/src/fee/ifde_txtedtpage.h",
- "xfa/src/fgas/include/fx_alg.h",
- "xfa/src/fgas/include/fx_cpg.h",
- "xfa/src/fgas/include/fx_datetime.h",
- "xfa/src/fgas/include/fx_fnt.h",
- "xfa/src/fgas/include/fx_lbk.h",
- "xfa/src/fgas/include/fx_lgg.h",
- "xfa/src/fgas/include/fx_locale.h",
- "xfa/src/fgas/include/fx_mem.h",
- "xfa/src/fgas/include/fx_rbk.h",
- "xfa/src/fgas/include/fx_sax.h",
- "xfa/src/fgas/include/fx_stm.h",
- "xfa/src/fgas/include/fx_sys.h",
- "xfa/src/fgas/include/fx_tbk.h",
- "xfa/src/fgas/include/fx_ucd.h",
- "xfa/src/fgas/include/fx_utl.h",
- "xfa/src/fgas/src/crt/fx_algorithm.cpp",
- "xfa/src/fgas/src/crt/fx_codepage.cpp",
- "xfa/src/fgas/src/crt/fx_encode.cpp",
- "xfa/src/fgas/src/crt/fx_memory.cpp",
- "xfa/src/fgas/src/crt/fx_memory.h",
- "xfa/src/fgas/src/crt/fx_stream.cpp",
- "xfa/src/fgas/src/crt/fx_stream.h",
- "xfa/src/fgas/src/crt/fx_system.cpp",
- "xfa/src/fgas/src/crt/fx_utils.cpp",
- "xfa/src/fgas/src/crt/fx_utils.h",
- "xfa/src/fgas/src/font/fx_fontutils.cpp",
- "xfa/src/fgas/src/font/fx_fontutils.h",
- "xfa/src/fgas/src/font/fx_gefont.cpp",
- "xfa/src/fgas/src/font/fx_gefont.h",
- "xfa/src/fgas/src/font/fx_stdfontmgr.cpp",
- "xfa/src/fgas/src/font/fx_stdfontmgr.h",
- "xfa/src/fgas/src/layout/fx_linebreak.cpp",
- "xfa/src/fgas/src/layout/fx_rtfbreak.cpp",
- "xfa/src/fgas/src/layout/fx_rtfbreak.h",
- "xfa/src/fgas/src/layout/fx_textbreak.cpp",
- "xfa/src/fgas/src/layout/fx_textbreak.h",
- "xfa/src/fgas/src/layout/fx_unicode.cpp",
- "xfa/src/fgas/src/layout/fx_unicode.h",
- "xfa/src/fgas/src/localization/fx_datetime.cpp",
- "xfa/src/fgas/src/localization/fx_locale.cpp",
- "xfa/src/fgas/src/localization/fx_localeimp.h",
- "xfa/src/fgas/src/localization/fx_localemgr.cpp",
- "xfa/src/fgas/src/localization/fx_localemgr.h",
- "xfa/src/fgas/src/xml/fx_sax_imp.cpp",
- "xfa/src/fgas/src/xml/fx_sax_imp.h",
+ "xfa/src/fgas/crt/fgas_algorithm.cpp",
+ "xfa/src/fgas/crt/fgas_algorithm.h",
+ "xfa/src/fgas/crt/fgas_codepage.cpp",
+ "xfa/src/fgas/crt/fgas_codepage.h",
+ "xfa/src/fgas/crt/fgas_encode.cpp",
+ "xfa/src/fgas/crt/fgas_language.h",
+ "xfa/src/fgas/crt/fgas_memory.cpp",
+ "xfa/src/fgas/crt/fgas_memory.h",
+ "xfa/src/fgas/crt/fgas_stream.cpp",
+ "xfa/src/fgas/crt/fgas_stream.h",
+ "xfa/src/fgas/crt/fgas_system.cpp",
+ "xfa/src/fgas/crt/fgas_system.h",
+ "xfa/src/fgas/crt/fgas_utils.cpp",
+ "xfa/src/fgas/crt/fgas_utils.h",
+ "xfa/src/fgas/font/fgas_font.h",
+ "xfa/src/fgas/font/fgas_fontutils.cpp",
+ "xfa/src/fgas/font/fgas_fontutils.h",
+ "xfa/src/fgas/font/fgas_gefont.cpp",
+ "xfa/src/fgas/font/fgas_gefont.h",
+ "xfa/src/fgas/font/fgas_stdfontmgr.cpp",
+ "xfa/src/fgas/font/fgas_stdfontmgr.h",
+ "xfa/src/fgas/layout/fgas_linebreak.cpp",
+ "xfa/src/fgas/layout/fgas_linebreak.h",
+ "xfa/src/fgas/layout/fgas_rtfbreak.cpp",
+ "xfa/src/fgas/layout/fgas_rtfbreak.h",
+ "xfa/src/fgas/layout/fgas_textbreak.cpp",
+ "xfa/src/fgas/layout/fgas_textbreak.h",
+ "xfa/src/fgas/layout/fgas_unicode.cpp",
+ "xfa/src/fgas/layout/fgas_unicode.h",
+ "xfa/src/fgas/localization/fgas_datetime.cpp",
+ "xfa/src/fgas/localization/fgas_datetime.h",
+ "xfa/src/fgas/localization/fgas_locale.cpp",
+ "xfa/src/fgas/localization/fgas_locale.h",
+ "xfa/src/fgas/localization/fgas_localeimp.h",
+ "xfa/src/fgas/localization/fgas_localemgr.cpp",
+ "xfa/src/fgas/localization/fgas_localemgr.h",
+ "xfa/src/fgas/xml/fgas_sax.h",
+ "xfa/src/fgas/xml/fgas_sax_imp.cpp",
+ "xfa/src/fgas/xml/fgas_sax_imp.h",
"xfa/src/fwl/basewidget/fwl_barcodeimp.cpp",
"xfa/src/fwl/basewidget/fwl_barcodeimp.h",
"xfa/src/fwl/basewidget/fwl_caretimp.cpp",
diff --git a/xfa.gyp b/xfa.gyp
index 755a2076ec..bc570de027 100644
--- a/xfa.gyp
+++ b/xfa.gyp
@@ -159,51 +159,45 @@
"xfa/src/fee/ifde_txtedtbuf.h",
"xfa/src/fee/ifde_txtedtengine.h",
"xfa/src/fee/ifde_txtedtpage.h",
- "xfa/src/fgas/include/fx_alg.h",
- "xfa/src/fgas/include/fx_cpg.h",
- "xfa/src/fgas/include/fx_datetime.h",
- "xfa/src/fgas/include/fx_fnt.h",
- "xfa/src/fgas/include/fx_lbk.h",
- "xfa/src/fgas/include/fx_lgg.h",
- "xfa/src/fgas/include/fx_locale.h",
- "xfa/src/fgas/include/fx_mem.h",
- "xfa/src/fgas/include/fx_rbk.h",
- "xfa/src/fgas/include/fx_sax.h",
- "xfa/src/fgas/include/fx_stm.h",
- "xfa/src/fgas/include/fx_sys.h",
- "xfa/src/fgas/include/fx_tbk.h",
- "xfa/src/fgas/include/fx_ucd.h",
- "xfa/src/fgas/include/fx_utl.h",
- "xfa/src/fgas/src/crt/fx_algorithm.cpp",
- "xfa/src/fgas/src/crt/fx_codepage.cpp",
- "xfa/src/fgas/src/crt/fx_encode.cpp",
- "xfa/src/fgas/src/crt/fx_memory.cpp",
- "xfa/src/fgas/src/crt/fx_memory.h",
- "xfa/src/fgas/src/crt/fx_stream.cpp",
- "xfa/src/fgas/src/crt/fx_stream.h",
- "xfa/src/fgas/src/crt/fx_system.cpp",
- "xfa/src/fgas/src/crt/fx_utils.cpp",
- "xfa/src/fgas/src/crt/fx_utils.h",
- "xfa/src/fgas/src/font/fx_fontutils.cpp",
- "xfa/src/fgas/src/font/fx_fontutils.h",
- "xfa/src/fgas/src/font/fx_gefont.cpp",
- "xfa/src/fgas/src/font/fx_gefont.h",
- "xfa/src/fgas/src/font/fx_stdfontmgr.cpp",
- "xfa/src/fgas/src/font/fx_stdfontmgr.h",
- "xfa/src/fgas/src/layout/fx_linebreak.cpp",
- "xfa/src/fgas/src/layout/fx_rtfbreak.cpp",
- "xfa/src/fgas/src/layout/fx_rtfbreak.h",
- "xfa/src/fgas/src/layout/fx_textbreak.cpp",
- "xfa/src/fgas/src/layout/fx_textbreak.h",
- "xfa/src/fgas/src/layout/fx_unicode.cpp",
- "xfa/src/fgas/src/layout/fx_unicode.h",
- "xfa/src/fgas/src/localization/fx_datetime.cpp",
- "xfa/src/fgas/src/localization/fx_locale.cpp",
- "xfa/src/fgas/src/localization/fx_localeimp.h",
- "xfa/src/fgas/src/localization/fx_localemgr.cpp",
- "xfa/src/fgas/src/localization/fx_localemgr.h",
- "xfa/src/fgas/src/xml/fx_sax_imp.cpp",
- "xfa/src/fgas/src/xml/fx_sax_imp.h",
+ "xfa/src/fgas/crt/fgas_algorithm.cpp",
+ "xfa/src/fgas/crt/fgas_algorithm.h",
+ "xfa/src/fgas/crt/fgas_codepage.cpp",
+ "xfa/src/fgas/crt/fgas_codepage.h",
+ "xfa/src/fgas/crt/fgas_encode.cpp",
+ "xfa/src/fgas/crt/fgas_language.h",
+ "xfa/src/fgas/crt/fgas_memory.cpp",
+ "xfa/src/fgas/crt/fgas_memory.h",
+ "xfa/src/fgas/crt/fgas_stream.cpp",
+ "xfa/src/fgas/crt/fgas_stream.h",
+ "xfa/src/fgas/crt/fgas_system.cpp",
+ "xfa/src/fgas/crt/fgas_system.h",
+ "xfa/src/fgas/crt/fgas_utils.cpp",
+ "xfa/src/fgas/crt/fgas_utils.h",
+ "xfa/src/fgas/font/fgas_font.h",
+ "xfa/src/fgas/font/fgas_fontutils.cpp",
+ "xfa/src/fgas/font/fgas_fontutils.h",
+ "xfa/src/fgas/font/fgas_gefont.cpp",
+ "xfa/src/fgas/font/fgas_gefont.h",
+ "xfa/src/fgas/font/fgas_stdfontmgr.cpp",
+ "xfa/src/fgas/font/fgas_stdfontmgr.h",
+ "xfa/src/fgas/layout/fgas_linebreak.cpp",
+ "xfa/src/fgas/layout/fgas_linebreak.h",
+ "xfa/src/fgas/layout/fgas_rtfbreak.cpp",
+ "xfa/src/fgas/layout/fgas_rtfbreak.h",
+ "xfa/src/fgas/layout/fgas_textbreak.cpp",
+ "xfa/src/fgas/layout/fgas_textbreak.h",
+ "xfa/src/fgas/layout/fgas_unicode.cpp",
+ "xfa/src/fgas/layout/fgas_unicode.h",
+ "xfa/src/fgas/localization/fgas_datetime.cpp",
+ "xfa/src/fgas/localization/fgas_datetime.h",
+ "xfa/src/fgas/localization/fgas_locale.cpp",
+ "xfa/src/fgas/localization/fgas_locale.h",
+ "xfa/src/fgas/localization/fgas_localeimp.h",
+ "xfa/src/fgas/localization/fgas_localemgr.cpp",
+ "xfa/src/fgas/localization/fgas_localemgr.h",
+ "xfa/src/fgas/xml/fgas_sax.h",
+ "xfa/src/fgas/xml/fgas_sax_imp.cpp",
+ "xfa/src/fgas/xml/fgas_sax_imp.h",
"xfa/src/fwl/basewidget/fwl_barcodeimp.cpp",
"xfa/src/fwl/basewidget/fwl_barcodeimp.h",
"xfa/src/fwl/basewidget/fwl_caretimp.cpp",
diff --git a/xfa/src/fdp/include/fde_css.h b/xfa/src/fdp/include/fde_css.h
index cc5ec2dbb1..b139855613 100644
--- a/xfa/src/fdp/include/fde_css.h
+++ b/xfa/src/fdp/include/fde_css.h
@@ -8,9 +8,9 @@
#define XFA_SRC_FDP_INCLUDE_FDE_CSS_H_
#include "core/include/fxge/fx_dib.h"
-#include "xfa/src/fgas/include/fx_fnt.h"
-#include "xfa/src/fgas/include/fx_stm.h"
-#include "xfa/src/fgas/include/fx_utl.h"
+#include "xfa/src/fgas/font/fgas_font.h"
+#include "xfa/src/fgas/crt/fgas_stream.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
class IFDE_CSSValue;
class IFDE_CSSValueList;
diff --git a/xfa/src/fdp/include/fde_img.h b/xfa/src/fdp/include/fde_img.h
index ea501259ed..fb7cd23fe6 100644
--- a/xfa/src/fdp/include/fde_img.h
+++ b/xfa/src/fdp/include/fde_img.h
@@ -7,9 +7,9 @@
#ifndef XFA_SRC_FDP_INCLUDE_FDE_IMG_H_
#define XFA_SRC_FDP_INCLUDE_FDE_IMG_H_
-#include "xfa/src/fgas/include/fx_mem.h"
-#include "xfa/src/fgas/include/fx_stm.h"
-#include "xfa/src/fgas/include/fx_utl.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
+#include "xfa/src/fgas/crt/fgas_stream.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
#define FDE_IMAGEFORMAT_Unknown -1
#define FDE_IMAGEFORMAT_BMP 0
diff --git a/xfa/src/fdp/include/fde_psr.h b/xfa/src/fdp/include/fde_psr.h
index 72ff91fa87..84140419b8 100644
--- a/xfa/src/fdp/include/fde_psr.h
+++ b/xfa/src/fdp/include/fde_psr.h
@@ -15,7 +15,7 @@
#include "xfa/src/fdp/include/fde_img.h"
#include "xfa/src/fdp/include/fde_pen.h"
#include "xfa/src/fdp/include/fde_pth.h"
-#include "xfa/src/fgas/include/fx_fnt.h"
+#include "xfa/src/fgas/font/fgas_font.h"
enum FDE_VISUALOBJTYPE {
FDE_VISUALOBJ_Canvas = 0x00,
diff --git a/xfa/src/fdp/include/fde_rdv.h b/xfa/src/fdp/include/fde_rdv.h
index ee11923011..d475a87ef0 100644
--- a/xfa/src/fdp/include/fde_rdv.h
+++ b/xfa/src/fdp/include/fde_rdv.h
@@ -11,7 +11,7 @@
#include "core/include/fxge/fx_font.h"
#include "core/include/fxge/fx_ge.h"
#include "xfa/src/fdp/include/fde_pth.h"
-#include "xfa/src/fgas/include/fx_fnt.h"
+#include "xfa/src/fgas/font/fgas_font.h"
class IFDE_Pen;
class IFDE_Brush;
diff --git a/xfa/src/fdp/include/fde_tto.h b/xfa/src/fdp/include/fde_tto.h
index dbfa64775c..78ac4d0c85 100644
--- a/xfa/src/fdp/include/fde_tto.h
+++ b/xfa/src/fdp/include/fde_tto.h
@@ -9,7 +9,7 @@
#include "core/include/fxge/fx_dib.h"
#include "core/include/fxge/fx_ge.h"
-#include "xfa/src/fgas/include/fx_fnt.h"
+#include "xfa/src/fgas/font/fgas_font.h"
#define FDE_TTOSTYLE_Underline 0x0001
#define FDE_TTOSTYLE_Strikeout 0x0002
diff --git a/xfa/src/fdp/include/fde_xml.h b/xfa/src/fdp/include/fde_xml.h
index 625914dd6e..f9eff3d251 100644
--- a/xfa/src/fdp/include/fde_xml.h
+++ b/xfa/src/fdp/include/fde_xml.h
@@ -7,8 +7,8 @@
#ifndef XFA_SRC_FDP_INCLUDE_FDE_XML_H_
#define XFA_SRC_FDP_INCLUDE_FDE_XML_H_
-#include "xfa/src/fgas/include/fx_stm.h"
-#include "xfa/src/fgas/include/fx_utl.h"
+#include "xfa/src/fgas/crt/fgas_stream.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
class IFDE_XMLNode;
class IFDE_XMLInstruction;
diff --git a/xfa/src/fdp/src/css/fde_csscache.h b/xfa/src/fdp/src/css/fde_csscache.h
index dad87e96f7..f7e7eb3aa7 100644
--- a/xfa/src/fdp/src/css/fde_csscache.h
+++ b/xfa/src/fdp/src/css/fde_csscache.h
@@ -10,7 +10,7 @@
#include <map>
#include "xfa/src/fdp/include/fde_css.h"
-#include "xfa/src/fgas/include/fx_mem.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
struct FDE_CSSCACHEITEM : public CFX_Target {
FDE_CSSCACHEITEM(IFDE_CSSStyleSheet* p);
diff --git a/xfa/src/fdp/src/css/fde_cssdatatable.cpp b/xfa/src/fdp/src/css/fde_cssdatatable.cpp
index 5b80d3ef6a..6f074c09b4 100644
--- a/xfa/src/fdp/src/css/fde_cssdatatable.cpp
+++ b/xfa/src/fdp/src/css/fde_cssdatatable.cpp
@@ -7,9 +7,9 @@
#include "xfa/src/fdp/src/css/fde_cssdatatable.h"
#include "core/include/fxcrt/fx_ext.h"
-#include "xfa/src/fgas/include/fx_alg.h"
-#include "xfa/src/fgas/include/fx_cpg.h"
-#include "xfa/src/fgas/include/fx_sys.h"
+#include "xfa/src/fgas/crt/fgas_algorithm.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
+#include "xfa/src/fgas/crt/fgas_system.h"
FX_BOOL FDE_CSSLengthToFloat(const FDE_CSSLENGTH& len,
FX_FLOAT fPercentBase,
diff --git a/xfa/src/fdp/src/css/fde_cssdatatable.h b/xfa/src/fdp/src/css/fde_cssdatatable.h
index 2502ed7fe5..512d94f3ee 100644
--- a/xfa/src/fdp/src/css/fde_cssdatatable.h
+++ b/xfa/src/fdp/src/css/fde_cssdatatable.h
@@ -9,7 +9,7 @@
#include "core/include/fxcrt/fx_system.h"
#include "xfa/src/fdp/include/fde_css.h"
-#include "xfa/src/fgas/include/fx_mem.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
class CFDE_CSSFunction : public CFX_Target {
public:
diff --git a/xfa/src/fdp/src/css/fde_cssdeclaration.cpp b/xfa/src/fdp/src/css/fde_cssdeclaration.cpp
index 73d0921b15..f63a1bef95 100644
--- a/xfa/src/fdp/src/css/fde_cssdeclaration.cpp
+++ b/xfa/src/fdp/src/css/fde_cssdeclaration.cpp
@@ -7,7 +7,7 @@
#include "xfa/src/fdp/src/css/fde_cssdeclaration.h"
#include "core/include/fxcrt/fx_ext.h"
-#include "xfa/src/fgas/include/fx_sys.h"
+#include "xfa/src/fgas/crt/fgas_system.h"
IFDE_CSSValue* CFDE_CSSDeclaration::GetProperty(FDE_CSSPROPERTY eProperty,
FX_BOOL& bImportant) const {
diff --git a/xfa/src/fdp/src/css/fde_cssstyleselector.h b/xfa/src/fdp/src/css/fde_cssstyleselector.h
index 15a45c1d8a..23e6616792 100644
--- a/xfa/src/fdp/src/css/fde_cssstyleselector.h
+++ b/xfa/src/fdp/src/css/fde_cssstyleselector.h
@@ -13,8 +13,8 @@
#include "xfa/src/fdp/include/fde_css.h"
#include "xfa/src/fdp/src/css/fde_csscache.h"
#include "xfa/src/fdp/src/css/fde_cssdeclaration.h"
-#include "xfa/src/fgas/include/fx_mem.h"
-#include "xfa/src/fgas/include/fx_sys.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
+#include "xfa/src/fgas/crt/fgas_system.h"
#define FDE_CSSUNIVERSALHASH ('*')
diff --git a/xfa/src/fdp/src/css/fde_cssstylesheet.cpp b/xfa/src/fdp/src/css/fde_cssstylesheet.cpp
index 59fd83b7fe..8afdc1c9a9 100644
--- a/xfa/src/fdp/src/css/fde_cssstylesheet.cpp
+++ b/xfa/src/fdp/src/css/fde_cssstylesheet.cpp
@@ -8,7 +8,7 @@
#include "xfa/src/fdp/src/css/fde_cssdatatable.h"
#include "xfa/src/fdp/src/css/fde_csssyntax.h"
-#include "xfa/src/fgas/include/fx_cpg.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadHTMLStandardStyleSheet() {
static const FX_WCHAR* s_pStyle =
diff --git a/xfa/src/fdp/src/css/fde_csssyntax.cpp b/xfa/src/fdp/src/css/fde_csssyntax.cpp
index 0ba7234633..30705d4960 100644
--- a/xfa/src/fdp/src/css/fde_csssyntax.cpp
+++ b/xfa/src/fdp/src/css/fde_csssyntax.cpp
@@ -7,7 +7,7 @@
#include "xfa/src/fdp/src/css/fde_csssyntax.h"
#include "xfa/src/fdp/src/css/fde_cssdatatable.h"
-#include "xfa/src/fgas/include/fx_cpg.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
#ifdef _cplusplus
extern "C" {
diff --git a/xfa/src/fdp/src/css/fde_csssyntax.h b/xfa/src/fdp/src/css/fde_csssyntax.h
index 1c7ba514b4..28e3ea366f 100644
--- a/xfa/src/fdp/src/css/fde_csssyntax.h
+++ b/xfa/src/fdp/src/css/fde_csssyntax.h
@@ -8,8 +8,8 @@
#define XFA_SRC_FDP_SRC_CSS_FDE_CSSSYNTAX_H_
#include "xfa/src/fdp/include/fde_css.h"
-#include "xfa/src/fgas/include/fx_mem.h"
-#include "xfa/src/fgas/include/fx_stm.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
+#include "xfa/src/fgas/crt/fgas_stream.h"
class CFDE_CSSTextBuf : public CFX_Target {
public:
diff --git a/xfa/src/fdp/src/fde/fde_gedevice.h b/xfa/src/fdp/src/fde/fde_gedevice.h
index 765ed954f8..56f0a0a379 100644
--- a/xfa/src/fdp/src/fde/fde_gedevice.h
+++ b/xfa/src/fdp/src/fde/fde_gedevice.h
@@ -8,7 +8,7 @@
#define XFA_SRC_FDP_SRC_FDE_FDE_GEDEVICE_H_
#include "xfa/src/fdp/include/fde_rdv.h"
-#include "xfa/src/fgas/include/fx_mem.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
class CFDE_FxgeDevice : public IFDE_RenderDevice, public CFX_Target {
public:
diff --git a/xfa/src/fdp/src/fde/fde_geobject.h b/xfa/src/fdp/src/fde/fde_geobject.h
index aa5847cf8e..a2d5fd4bad 100644
--- a/xfa/src/fdp/src/fde/fde_geobject.h
+++ b/xfa/src/fdp/src/fde/fde_geobject.h
@@ -9,7 +9,7 @@
#include "core/include/fxge/fx_ge.h"
#include "xfa/src/fdp/include/fde_pth.h"
-#include "xfa/src/fgas/include/fx_mem.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
class CFDE_Path : public IFDE_Path, public CFX_Target {
public:
diff --git a/xfa/src/fdp/src/fde/fde_iterator.cpp b/xfa/src/fdp/src/fde/fde_iterator.cpp
index f79a41a001..4a286ec721 100644
--- a/xfa/src/fdp/src/fde/fde_iterator.cpp
+++ b/xfa/src/fdp/src/fde/fde_iterator.cpp
@@ -6,7 +6,7 @@
#include "xfa/src/fdp/src/fde/fde_iterator.h"
-#include "xfa/src/fgas/include/fx_utl.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
IFDE_VisualSetIterator* IFDE_VisualSetIterator::Create() {
return new CFDE_VisualSetIterator;
diff --git a/xfa/src/fdp/src/fde/fde_iterator.h b/xfa/src/fdp/src/fde/fde_iterator.h
index 52bfdbad6a..a8594af696 100644
--- a/xfa/src/fdp/src/fde/fde_iterator.h
+++ b/xfa/src/fdp/src/fde/fde_iterator.h
@@ -8,7 +8,7 @@
#define XFA_SRC_FDP_SRC_FDE_FDE_ITERATOR_H_
#include "xfa/src/fdp/include/fde_psr.h"
-#include "xfa/src/fgas/include/fx_mem.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
struct FDE_CANVASITEM : public CFX_Target {
IFDE_CanvasSet* pCanvas;
diff --git a/xfa/src/fdp/src/fde/fde_object.h b/xfa/src/fdp/src/fde/fde_object.h
index 4e90ed2aa6..22c1fe30ca 100644
--- a/xfa/src/fdp/src/fde/fde_object.h
+++ b/xfa/src/fdp/src/fde/fde_object.h
@@ -12,7 +12,7 @@
#include "core/include/fxge/fx_dib.h"
#include "xfa/src/fdp/include/fde_brs.h"
#include "xfa/src/fdp/include/fde_pen.h"
-#include "xfa/src/fgas/include/fx_mem.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
class CFDE_Pen : public IFDE_Pen, public CFX_Target {
public:
diff --git a/xfa/src/fdp/src/fde/fde_render.h b/xfa/src/fdp/src/fde/fde_render.h
index ce405a21fb..389c00e63b 100644
--- a/xfa/src/fdp/src/fde/fde_render.h
+++ b/xfa/src/fdp/src/fde/fde_render.h
@@ -10,7 +10,7 @@
#include "xfa/src/fdp/include/fde_psr.h"
#include "xfa/src/fdp/include/fde_rdr.h"
#include "xfa/src/fdp/include/fde_rdv.h"
-#include "xfa/src/fgas/include/fx_mem.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
class CFDE_RenderContext : public IFDE_RenderContext,
public CFX_Target {
diff --git a/xfa/src/fdp/src/tto/fde_textout.h b/xfa/src/fdp/src/tto/fde_textout.h
index afe62a613b..29c326fc1c 100644
--- a/xfa/src/fdp/src/tto/fde_textout.h
+++ b/xfa/src/fdp/src/tto/fde_textout.h
@@ -14,10 +14,10 @@
#include "xfa/src/fdp/include/fde_pen.h"
#include "xfa/src/fdp/include/fde_rdv.h"
#include "xfa/src/fdp/include/fde_tto.h"
-#include "xfa/src/fgas/include/fx_fnt.h"
-#include "xfa/src/fgas/include/fx_mem.h"
-#include "xfa/src/fgas/include/fx_tbk.h"
-#include "xfa/src/fgas/include/fx_utl.h"
+#include "xfa/src/fgas/font/fgas_font.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
+#include "xfa/src/fgas/layout/fgas_textbreak.h"
struct FDE_TTOPIECE {
public:
diff --git a/xfa/src/fdp/src/xml/fde_xml_imp.cpp b/xfa/src/fdp/src/xml/fde_xml_imp.cpp
index 91486eb29b..0071b78135 100644
--- a/xfa/src/fdp/src/xml/fde_xml_imp.cpp
+++ b/xfa/src/fdp/src/xml/fde_xml_imp.cpp
@@ -8,8 +8,8 @@
#include <algorithm>
-#include "xfa/src/fgas/include/fx_cpg.h"
-#include "xfa/src/fgas/include/fx_sys.h"
+#include "xfa/src/fgas/crt/fgas_system.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
#define FDE_XMLVALIDCHARRANGENUM 5
diff --git a/xfa/src/fdp/src/xml/fde_xml_imp.h b/xfa/src/fdp/src/xml/fde_xml_imp.h
index 31711df9a5..32c3de5c21 100644
--- a/xfa/src/fdp/src/xml/fde_xml_imp.h
+++ b/xfa/src/fdp/src/xml/fde_xml_imp.h
@@ -9,8 +9,8 @@
#include "core/include/fxcrt/fx_system.h"
#include "xfa/src/fdp/include/fde_xml.h"
-#include "xfa/src/fgas/include/fx_mem.h"
-#include "xfa/src/fgas/include/fx_stm.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
+#include "xfa/src/fgas/crt/fgas_stream.h"
class CFDE_BlockBuffer;
class CFDE_XMLInstruction;
diff --git a/xfa/src/fee/fde_txtedtbuf.h b/xfa/src/fee/fde_txtedtbuf.h
index 1b2d19f7e8..9fb6ac1b87 100644
--- a/xfa/src/fee/fde_txtedtbuf.h
+++ b/xfa/src/fee/fde_txtedtbuf.h
@@ -9,7 +9,7 @@
#include "xfa/src/fee/ifde_txtedtbuf.h"
#include "xfa/src/fee/ifde_txtedtengine.h"
-#include "xfa/src/fgas/include/fx_mem.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
class IFX_CharIter;
class CFDE_TxtEdtBuf;
diff --git a/xfa/src/fee/fde_txtedtpage.h b/xfa/src/fee/fde_txtedtpage.h
index e51f80ef8a..520ecb727f 100644
--- a/xfa/src/fee/fde_txtedtpage.h
+++ b/xfa/src/fee/fde_txtedtpage.h
@@ -11,7 +11,7 @@
#include "core/include/fxcrt/fx_string.h"
#include "xfa/src/fdp/include/fde_psr.h"
#include "xfa/src/fee/ifde_txtedtpage.h"
-#include "xfa/src/fgas/include/fx_utl.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
class IFX_CharIter;
class CFDE_TxtEdtEngine;
diff --git a/xfa/src/fee/fde_txtedtparag.cpp b/xfa/src/fee/fde_txtedtparag.cpp
index e5d1d9d3f1..32f846b52b 100644
--- a/xfa/src/fee/fde_txtedtparag.cpp
+++ b/xfa/src/fee/fde_txtedtparag.cpp
@@ -11,7 +11,7 @@
#include "xfa/src/fee/fx_wordbreak/fx_wordbreak.h"
#include "xfa/src/fee/ifde_txtedtbuf.h"
#include "xfa/src/fee/ifde_txtedtengine.h"
-#include "xfa/src/fgas/include/fx_tbk.h"
+#include "xfa/src/fgas/layout/fgas_textbreak.h"
CFDE_TxtEdtParag::CFDE_TxtEdtParag(CFDE_TxtEdtEngine* pEngine)
: m_nCharStart(0),
diff --git a/xfa/src/fee/ifde_txtedtengine.h b/xfa/src/fee/ifde_txtedtengine.h
index 053fd1ce6b..f49e086768 100644
--- a/xfa/src/fee/ifde_txtedtengine.h
+++ b/xfa/src/fee/ifde_txtedtengine.h
@@ -8,7 +8,7 @@
#define XFA_SRC_FEE_IFDE_TXTEDTENGINE_H_
#include "core/include/fxge/fx_dib.h"
-#include "xfa/src/fgas/include/fx_fnt.h"
+#include "xfa/src/fgas/font/fgas_font.h"
class IFDE_TxtEdtPage;
class IFDE_TxtEdtEngine;
diff --git a/xfa/src/fee/ifde_txtedtpage.h b/xfa/src/fee/ifde_txtedtpage.h
index c0236ff0b0..1a4a2fe82f 100644
--- a/xfa/src/fee/ifde_txtedtpage.h
+++ b/xfa/src/fee/ifde_txtedtpage.h
@@ -9,7 +9,7 @@
#include "core/include/fxge/fx_ge.h"
#include "xfa/src/fdp/include/fde_psr.h"
-#include "xfa/src/fgas/include/fx_tbk.h"
+#include "xfa/src/fgas/layout/fgas_textbreak.h"
class IFDE_TxtEdtEngine;
class IFDE_TxtEdtPage : public IFDE_CanvasSet, public IFX_TxtAccess {
diff --git a/xfa/src/fgas/src/crt/fx_algorithm.cpp b/xfa/src/fgas/crt/fgas_algorithm.cpp
index 7de22b73fa..60b43ac886 100644
--- a/xfa/src/fgas/src/crt/fx_algorithm.cpp
+++ b/xfa/src/fgas/crt/fgas_algorithm.cpp
@@ -4,6 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "xfa/src/fgas/crt/fgas_algorithm.h"
+
#include "core/include/fxcrt/fx_basic.h"
#ifdef __cplusplus
diff --git a/xfa/src/fgas/include/fx_alg.h b/xfa/src/fgas/crt/fgas_algorithm.h
index e2682729a3..f819716820 100644
--- a/xfa/src/fgas/include/fx_alg.h
+++ b/xfa/src/fgas/crt/fgas_algorithm.h
@@ -4,15 +4,13 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_ALG_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_ALG_H_
+#ifndef XFA_SRC_FGAS_CRT_FGAS_ALGORITHM_H_
+#define XFA_SRC_FGAS_CRT_FGAS_ALGORITHM_H_
#include <cstdint>
#include "core/include/fxcrt/fx_basic.h"
-#define FX_IsOdd(a) ((a)&1)
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -53,4 +51,4 @@ class CFX_DSPATemplate {
}
};
-#endif // XFA_SRC_FGAS_INCLUDE_FX_ALG_H_
+#endif // XFA_SRC_FGAS_CRT_FGAS_ALGORITHM_H_
diff --git a/xfa/src/fgas/src/crt/fx_codepage.cpp b/xfa/src/fgas/crt/fgas_codepage.cpp
index 0928d005ff..622c4174bc 100644
--- a/xfa/src/fgas/src/crt/fx_codepage.cpp
+++ b/xfa/src/fgas/crt/fgas_codepage.cpp
@@ -5,8 +5,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "core/include/fxcrt/fx_ext.h"
-#include "xfa/src/fgas/include/fx_cpg.h"
-#include "xfa/src/fgas/include/fx_lgg.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
+#include "xfa/src/fgas/crt/fgas_language.h"
static const FX_CHARSET_MAP g_FXCharset2CodePageTable[] = {
{0, 1252}, {1, 0}, {2, 42}, {77, 10000}, {78, 10001},
diff --git a/xfa/src/fgas/include/fx_cpg.h b/xfa/src/fgas/crt/fgas_codepage.h
index 0652411779..e9111d1ec4 100644
--- a/xfa/src/fgas/include/fx_cpg.h
+++ b/xfa/src/fgas/crt/fgas_codepage.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_CPG_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_CPG_H_
+#ifndef XFA_SRC_FGAS_CRT_FGAS_CODEPAGE_H_
+#define XFA_SRC_FGAS_CRT_FGAS_CODEPAGE_H_
#include "core/include/fxcrt/fx_basic.h"
@@ -132,6 +132,7 @@
#define FX_CHARSET_MSWin_EasterEuropean 238
#define FX_CHARSET_US 254
#define FX_CHARSET_OEM 255
+
FX_WORD FX_GetCodePageFromCharset(uint8_t charset);
FX_WORD FX_GetCharsetFromCodePage(FX_WORD codepage);
FX_WORD FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength);
@@ -159,66 +160,6 @@ int32_t FX_UTF8Decode(const FX_CHAR* pSrc,
int32_t* pSrcLen,
FX_WCHAR* pDst,
int32_t* pDstLen);
-enum FX_CODESYSTEM {
- FX_MBCS = 0,
- FX_SBCS,
- FX_DBCS,
-};
-
-struct FX_CODEPAGE_HEADER {
- uint16_t uCPID;
- uint8_t uMinCharBytes;
- uint8_t uMaxCharBytes;
- FX_CODESYSTEM eCPType;
- FX_BOOL bHasLeadByte;
- FX_WCHAR wMinChar;
- FX_WCHAR wMaxChar;
- FX_WCHAR wDefChar;
- FX_WCHAR wMinUnicode;
- FX_WCHAR wMaxUnicode;
- FX_WCHAR wDefUnicode;
-};
-
-#define FX_CPMAPTYPE_Consecution 1
-#define FX_CPMAPTYPE_Strict 2
-#define FX_CPMAPTYPE_NoMapping 3
-#define FX_CPMAPTYPE_Delta 4
-
-struct FX_CPCU_MAPTABLE1 {
- uint16_t uMapType;
- uint16_t uUniocde;
-};
-
-struct FX_CPCU_MAPTABLE2 {
- uint8_t uTrailByte;
- uint8_t uMapType;
- uint16_t uOffset;
-};
-
-struct FX_CPCU_MAPINFO {
- FX_CPCU_MAPTABLE1* pMapTable1;
- FX_CPCU_MAPTABLE2* pMapTable2;
- const uint8_t* pMapData;
-};
-
-struct FX_CPUC_MAPTABLE {
- uint16_t uStartUnicode;
- uint16_t uEndUnicode;
- uint16_t uMapType;
- uint16_t uOffset;
-};
-
-struct FX_CPUC_MAPINFO {
- uint32_t uMapCount;
- FX_CPUC_MAPTABLE* pMapTable;
- const uint8_t* pMapData;
-};
-
-struct FX_CODEPAGE {
- FX_CODEPAGE_HEADER const* pCPHeader;
- FX_CPCU_MAPINFO const* pCPCUMapInfo;
- FX_CPUC_MAPINFO const* pCPUCMapInfo;
-};
struct FX_STR2CPHASH {
uint32_t uHash;
@@ -235,27 +176,4 @@ struct FX_LANG2CPMAP {
FX_WORD wCodepage;
};
-class IFX_CodePage {
- public:
- static IFX_CodePage* Create(FX_WORD wCodePage);
- virtual ~IFX_CodePage() {}
- virtual void Release() = 0;
- virtual FX_WORD GetCodePageNumber() const = 0;
- virtual FX_CODESYSTEM GetCodeSystemType() const = 0;
- virtual FX_BOOL HasLeadByte() const = 0;
- virtual FX_BOOL IsLeadByte(uint8_t byte) const = 0;
- virtual int32_t GetMinBytesPerChar() const = 0;
- virtual int32_t GetMaxBytesPerChar() const = 0;
- virtual FX_WCHAR GetMinCharcode() const = 0;
- virtual FX_WCHAR GetMaxCharcode() const = 0;
- virtual FX_WCHAR GetDefCharcode() const = 0;
- virtual FX_WCHAR GetMinUnicode() const = 0;
- virtual FX_WCHAR GetMaxUnicode() const = 0;
- virtual FX_WCHAR GetDefUnicode() const = 0;
- virtual FX_BOOL IsValidCharcode(FX_WORD wCharcode) const = 0;
- virtual FX_WCHAR GetUnicode(FX_WORD wCharcode) const = 0;
- virtual FX_BOOL IsValidUnicode(FX_WCHAR wUnicode) const = 0;
- virtual FX_WORD GetCharcode(FX_WCHAR wUnicode) const = 0;
-};
-
-#endif // XFA_SRC_FGAS_INCLUDE_FX_CPG_H_
+#endif // XFA_SRC_FGAS_CRT_FGAS_CODEPAGE_H_
diff --git a/xfa/src/fgas/src/crt/fx_encode.cpp b/xfa/src/fgas/crt/fgas_encode.cpp
index 79be09819a..564ccf63c4 100644
--- a/xfa/src/fgas/src/crt/fx_encode.cpp
+++ b/xfa/src/fgas/crt/fgas_encode.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/src/fgas/include/fx_cpg.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
void FX_SwapByteOrder(FX_WCHAR* pStr, int32_t iLength) {
FXSYS_assert(pStr != NULL);
diff --git a/xfa/src/fgas/include/fx_lgg.h b/xfa/src/fgas/crt/fgas_language.h
index 68e7ebd3ba..15f32e1379 100644
--- a/xfa/src/fgas/include/fx_lgg.h
+++ b/xfa/src/fgas/crt/fgas_language.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_LGG_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_LGG_H_
+#ifndef XFA_SRC_FGAS_CRT_FGAS_LANGUAGE_H_
+#define XFA_SRC_FGAS_CRT_FGAS_LANGUAGE_H_
#define FX_LANG_Neutral 0x0000
#define FX_LANG_Invariant 0x007f
@@ -266,4 +266,4 @@
#define FX_LANG_Yiddish 0x043d
#define FX_LANG_Yoruba_Nigeria 0x046a
-#endif // XFA_SRC_FGAS_INCLUDE_FX_LGG_H_
+#endif // XFA_SRC_FGAS_CRT_FGAS_LANGUAGE_H_
diff --git a/xfa/src/fgas/src/crt/fx_memory.cpp b/xfa/src/fgas/crt/fgas_memory.cpp
index 5c14a9430c..c88c7e3aac 100644
--- a/xfa/src/fgas/src/crt/fx_memory.cpp
+++ b/xfa/src/fgas/crt/fgas_memory.cpp
@@ -4,10 +4,138 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/src/fgas/src/crt/fx_memory.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
#include <algorithm>
+namespace {
+
+class CFX_DefStore : public IFX_MEMAllocator, public CFX_Target {
+ public:
+ CFX_DefStore() {}
+ ~CFX_DefStore() {}
+ virtual void Release() { delete this; }
+ virtual void* Alloc(size_t size) { return FX_Alloc(uint8_t, size); }
+ virtual void Free(void* pBlock) { FX_Free(pBlock); }
+ virtual size_t GetBlockSize() const { return 0; }
+ virtual size_t GetDefChunkSize() const { return 0; }
+ virtual size_t SetDefChunkSize(size_t size) { return 0; }
+ virtual size_t GetCurrentDataSize() const { return 0; }
+};
+
+#if _FX_OS_ != _FX_ANDROID_
+#pragma pack(push, 1)
+#endif
+struct FX_STATICSTORECHUNK {
+ FX_STATICSTORECHUNK* pNextChunk;
+ size_t iChunkSize;
+ size_t iFreeSize;
+};
+#if _FX_OS_ != _FX_ANDROID_
+#pragma pack(pop)
+#endif
+
+class CFX_StaticStore : public IFX_MEMAllocator, public CFX_Target {
+ public:
+ CFX_StaticStore(size_t iDefChunkSize = 4096);
+ ~CFX_StaticStore();
+ virtual void Release() { delete this; }
+ virtual void* Alloc(size_t size);
+ virtual void Free(void* pBlock) {}
+ virtual size_t GetBlockSize() const { return 0; }
+ virtual size_t GetDefChunkSize() const { return m_iDefChunkSize; }
+ virtual size_t SetDefChunkSize(size_t size);
+ virtual size_t GetCurrentDataSize() const { return m_iAllocatedSize; }
+
+ protected:
+ size_t m_iAllocatedSize;
+ size_t m_iDefChunkSize;
+ FX_STATICSTORECHUNK* m_pChunk;
+ FX_STATICSTORECHUNK* m_pLastChunk;
+ FX_STATICSTORECHUNK* AllocChunk(size_t size);
+ FX_STATICSTORECHUNK* FindChunk(size_t size);
+};
+
+#if _FX_OS_ != _FX_ANDROID_
+#pragma pack(push, 1)
+#endif
+struct FX_FIXEDSTORECHUNK {
+ uint8_t* FirstFlag() { return reinterpret_cast<uint8_t*>(this + 1); }
+ uint8_t* FirstBlock() { return FirstFlag() + iChunkSize; }
+
+ FX_FIXEDSTORECHUNK* pNextChunk;
+ size_t iChunkSize;
+ size_t iFreeNum;
+};
+#if _FX_OS_ != _FX_ANDROID_
+#pragma pack(pop)
+#endif
+
+class CFX_FixedStore : public IFX_MEMAllocator, public CFX_Target {
+ public:
+ CFX_FixedStore(size_t iBlockSize, size_t iBlockNumsInChunk);
+ virtual ~CFX_FixedStore();
+ virtual void Release() { delete this; }
+ virtual void* Alloc(size_t size);
+ virtual void Free(void* pBlock);
+ virtual size_t GetBlockSize() const { return m_iBlockSize; }
+ virtual size_t GetDefChunkSize() const { return m_iDefChunkSize; }
+ virtual size_t SetDefChunkSize(size_t iChunkSize);
+ virtual size_t GetCurrentDataSize() const { return 0; }
+
+ protected:
+ FX_FIXEDSTORECHUNK* AllocChunk();
+
+ size_t m_iBlockSize;
+ size_t m_iDefChunkSize;
+ FX_FIXEDSTORECHUNK* m_pChunk;
+};
+
+#if _FX_OS_ != _FX_ANDROID_
+#pragma pack(push, 1)
+#endif
+struct FX_DYNAMICSTOREBLOCK {
+ uint8_t* Data() { return reinterpret_cast<uint8_t*>(this + 1); }
+ FX_DYNAMICSTOREBLOCK* NextBlock() {
+ return reinterpret_cast<FX_DYNAMICSTOREBLOCK*>(Data() + iBlockSize);
+ }
+ size_t iBlockSize;
+ FX_BOOL bUsed;
+};
+
+struct FX_DYNAMICSTORECHUNK {
+ FX_DYNAMICSTOREBLOCK* FirstBlock() {
+ return reinterpret_cast<FX_DYNAMICSTOREBLOCK*>(this + 1);
+ }
+ FX_DYNAMICSTORECHUNK* pNextChunk;
+ size_t iChunkSize;
+ size_t iFreeSize;
+};
+#if _FX_OS_ != _FX_ANDROID_
+#pragma pack(pop)
+#endif
+
+class CFX_DynamicStore : public IFX_MEMAllocator, public CFX_Target {
+ public:
+ CFX_DynamicStore(size_t iDefChunkSize = 4096);
+ virtual ~CFX_DynamicStore();
+ virtual void Release() { delete this; }
+ virtual void* Alloc(size_t size);
+ virtual void Free(void* pBlock);
+ virtual size_t GetBlockSize() const { return 0; }
+ virtual size_t GetDefChunkSize() const { return m_iDefChunkSize; }
+ virtual size_t SetDefChunkSize(size_t size);
+ virtual size_t GetCurrentDataSize() const { return 0; }
+
+ protected:
+ FX_DYNAMICSTORECHUNK* AllocChunk(size_t size);
+
+ size_t m_iDefChunkSize;
+ FX_DYNAMICSTORECHUNK* m_pChunk;
+};
+
+} // namespace
+
#define FX_4BYTEALIGN(size) (((size) + 3) / 4 * 4)
IFX_MEMAllocator* FX_CreateAllocator(FX_ALLOCTYPE eType,
diff --git a/xfa/src/fgas/include/fx_mem.h b/xfa/src/fgas/crt/fgas_memory.h
index e768c454ac..90a8ddaf9a 100644
--- a/xfa/src/fgas/include/fx_mem.h
+++ b/xfa/src/fgas/crt/fgas_memory.h
@@ -4,10 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_MEM_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_MEM_H_
+#ifndef XFA_SRC_FGAS_CRT_FGAS_MEMORY_H_
+#define XFA_SRC_FGAS_CRT_FGAS_MEMORY_H_
-#include "core/include/fxcrt/fx_memory.h" // For FX_Alloc().
+#include "core/include/fxcrt/fx_memory.h"
+#include "core/include/fxcrt/fx_system.h"
class IFX_MEMAllocator;
class CFX_Target;
@@ -55,4 +56,4 @@ class CFX_Target {
(pointer)->operator delete((pointer), (__allocator__)); \
}
-#endif // XFA_SRC_FGAS_INCLUDE_FX_MEM_H_
+#endif // XFA_SRC_FGAS_CRT_FGAS_MEMORY_H_
diff --git a/xfa/src/fgas/src/crt/fx_stream.cpp b/xfa/src/fgas/crt/fgas_stream.cpp
index 4f5c292ab8..c515b56662 100644
--- a/xfa/src/fgas/src/crt/fx_stream.cpp
+++ b/xfa/src/fgas/crt/fgas_stream.cpp
@@ -4,12 +4,310 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/src/fgas/src/crt/fx_stream.h"
+#include "xfa/src/fgas/crt/fgas_stream.h"
#include <algorithm>
-#include "xfa/src/fgas/include/fx_cpg.h"
-#include "xfa/src/fgas/include/fx_sys.h"
+#include "xfa/src/fgas/crt/fgas_system.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
+
+namespace {
+
+class CFX_StreamImp {
+ public:
+ virtual void Release() { delete this; }
+ virtual FX_DWORD GetAccessModes() const { return m_dwAccess; }
+ virtual int32_t GetLength() const = 0;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0;
+ virtual int32_t GetPosition() = 0;
+ virtual FX_BOOL IsEOF() const = 0;
+ virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) = 0;
+ virtual int32_t ReadString(FX_WCHAR* pStr,
+ int32_t iMaxLength,
+ FX_BOOL& bEOS) = 0;
+ virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) = 0;
+ virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) = 0;
+ virtual void Flush() = 0;
+ virtual FX_BOOL SetLength(int32_t iLength) = 0;
+
+ protected:
+ CFX_StreamImp();
+ virtual ~CFX_StreamImp() {}
+ FX_DWORD m_dwAccess;
+};
+
+class CFX_FileStreamImp : public CFX_StreamImp {
+ public:
+ CFX_FileStreamImp();
+ virtual ~CFX_FileStreamImp();
+ FX_BOOL LoadFile(const FX_WCHAR* pszSrcFileName, FX_DWORD dwAccess);
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
+ virtual FX_BOOL IsEOF() const;
+ virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS);
+ virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength);
+ virtual void Flush();
+ virtual FX_BOOL SetLength(int32_t iLength);
+
+ protected:
+ FXSYS_FILE* m_hFile;
+ int32_t m_iLength;
+};
+
+class CFX_BufferStreamImp : public CFX_StreamImp {
+ public:
+ CFX_BufferStreamImp();
+ virtual ~CFX_BufferStreamImp() {}
+ FX_BOOL LoadBuffer(uint8_t* pData, int32_t iTotalSize, FX_DWORD dwAccess);
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
+ virtual FX_BOOL IsEOF() const;
+ virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS);
+ virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength);
+ virtual void Flush() {}
+ virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; }
+
+ protected:
+ uint8_t* m_pData;
+ int32_t m_iTotalSize;
+ int32_t m_iPosition;
+ int32_t m_iLength;
+};
+
+class CFX_FileReadStreamImp : public CFX_StreamImp {
+ public:
+ CFX_FileReadStreamImp();
+ virtual ~CFX_FileReadStreamImp() {}
+ FX_BOOL LoadFileRead(IFX_FileRead* pFileRead, FX_DWORD dwAccess);
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition() { return m_iPosition; }
+ virtual FX_BOOL IsEOF() const;
+
+ virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS);
+ virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) {
+ return 0;
+ }
+ virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) {
+ return 0;
+ }
+ virtual void Flush() {}
+ virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; }
+
+ protected:
+ IFX_FileRead* m_pFileRead;
+ int32_t m_iPosition;
+ int32_t m_iLength;
+};
+
+class CFX_BufferReadStreamImp : public CFX_StreamImp {
+ public:
+ CFX_BufferReadStreamImp();
+ ~CFX_BufferReadStreamImp();
+ FX_BOOL LoadBufferRead(IFX_BufferRead* pBufferRead,
+ int32_t iFileSize,
+ FX_DWORD dwAccess,
+ FX_BOOL bReleaseBufferRead);
+
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition() { return m_iPosition; }
+ virtual FX_BOOL IsEOF() const;
+
+ virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS);
+ virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) {
+ return 0;
+ }
+ virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) {
+ return 0;
+ }
+ virtual void Flush() {}
+ virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; }
+
+ private:
+ IFX_BufferRead* m_pBufferRead;
+ FX_BOOL m_bReleaseBufferRead;
+ int32_t m_iPosition;
+ int32_t m_iBufferSize;
+};
+
+class CFX_FileWriteStreamImp : public CFX_StreamImp {
+ public:
+ CFX_FileWriteStreamImp();
+ virtual ~CFX_FileWriteStreamImp() {}
+ FX_BOOL LoadFileWrite(IFX_FileWrite* pFileWrite, FX_DWORD dwAccess);
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition() { return m_iPosition; }
+ virtual FX_BOOL IsEOF() const;
+ virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) { return 0; }
+ virtual int32_t ReadString(FX_WCHAR* pStr,
+ int32_t iMaxLength,
+ FX_BOOL& bEOS) {
+ return 0;
+ }
+ virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength);
+ virtual void Flush();
+ virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; }
+
+ protected:
+ IFX_FileWrite* m_pFileWrite;
+ int32_t m_iPosition;
+};
+
+enum FX_STREAMTYPE {
+ FX_SREAMTYPE_Unknown = 0,
+ FX_STREAMTYPE_File,
+ FX_STREAMTYPE_Buffer,
+ FX_STREAMTYPE_Stream,
+ FX_STREAMTYPE_BufferRead,
+};
+
+class CFX_Stream : public IFX_Stream {
+ public:
+ CFX_Stream();
+ ~CFX_Stream();
+ FX_BOOL LoadFile(const FX_WCHAR* pszSrcFileName, FX_DWORD dwAccess);
+ FX_BOOL LoadBuffer(uint8_t* pData, int32_t iTotalSize, FX_DWORD dwAccess);
+ FX_BOOL LoadFileRead(IFX_FileRead* pFileRead, FX_DWORD dwAccess);
+ FX_BOOL LoadFileWrite(IFX_FileWrite* pFileWrite, FX_DWORD dwAccess);
+ FX_BOOL LoadBufferRead(IFX_BufferRead* pBufferRead,
+ int32_t iFileSize,
+ FX_DWORD dwAccess,
+ FX_BOOL bReleaseBufferRead);
+ virtual void Release();
+ virtual IFX_Stream* Retain();
+ virtual FX_DWORD GetAccessModes() const { return m_dwAccess; }
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
+ virtual FX_BOOL IsEOF() const;
+ virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_WCHAR* pStr,
+ int32_t iMaxLength,
+ FX_BOOL& bEOS,
+ int32_t const* pByteSize = NULL);
+ virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength);
+ virtual void Flush();
+ virtual FX_BOOL SetLength(int32_t iLength);
+ virtual int32_t GetBOM(uint8_t bom[4]) const;
+ virtual FX_WORD GetCodePage() const;
+ virtual FX_WORD SetCodePage(FX_WORD wCodePage);
+ virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess,
+ int32_t iOffset,
+ int32_t iLength);
+
+ protected:
+ FX_STREAMTYPE m_eStreamType;
+ CFX_StreamImp* m_pStreamImp;
+ FX_DWORD m_dwAccess;
+ int32_t m_iTotalSize;
+ int32_t m_iPosition;
+ int32_t m_iStart;
+ int32_t m_iLength;
+ int32_t m_iRefCount;
+};
+
+class CFX_TextStream : public IFX_Stream {
+ public:
+ CFX_TextStream(IFX_Stream* pStream, FX_BOOL bDelStream);
+ ~CFX_TextStream();
+ virtual void Release();
+ virtual IFX_Stream* Retain();
+
+ virtual FX_DWORD GetAccessModes() const;
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
+ virtual FX_BOOL IsEOF() const;
+
+ virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_WCHAR* pStr,
+ int32_t iMaxLength,
+ FX_BOOL& bEOS,
+ int32_t const* pByteSize = NULL);
+ virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength);
+ virtual void Flush();
+ virtual FX_BOOL SetLength(int32_t iLength);
+
+ virtual int32_t GetBOM(uint8_t bom[4]) const;
+ virtual FX_WORD GetCodePage() const;
+ virtual FX_WORD SetCodePage(FX_WORD wCodePage);
+
+ virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess,
+ int32_t iOffset,
+ int32_t iLength);
+
+ protected:
+ FX_WORD m_wCodePage;
+ int32_t m_wBOMLength;
+ FX_DWORD m_dwBOM;
+ uint8_t* m_pBuf;
+ int32_t m_iBufSize;
+ FX_BOOL m_bDelStream;
+ IFX_Stream* m_pStreamImp;
+ int32_t m_iRefCount;
+ void InitStream();
+};
+
+class CFGAS_FileRead : public IFX_FileRead {
+ public:
+ CFGAS_FileRead(IFX_Stream* pStream, FX_BOOL bReleaseStream);
+ virtual ~CFGAS_FileRead();
+ virtual void Release() { delete this; }
+ virtual FX_FILESIZE GetSize();
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);
+
+ protected:
+ FX_BOOL m_bReleaseStream;
+ IFX_Stream* m_pStream;
+};
+
+class CFX_BufferAccImp : public IFX_FileRead {
+ public:
+ CFX_BufferAccImp(IFX_BufferRead* pBufferRead,
+ FX_FILESIZE iFileSize,
+ FX_BOOL bReleaseStream);
+ virtual ~CFX_BufferAccImp();
+ virtual void Release() { delete this; }
+ virtual FX_FILESIZE GetSize();
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);
+
+ protected:
+ IFX_BufferRead* m_pBufferRead;
+ FX_BOOL m_bReleaseStream;
+ FX_FILESIZE m_iBufSize;
+};
+
+class CFGAS_FileWrite : public IFX_FileWrite {
+ public:
+ CFGAS_FileWrite(IFX_Stream* pStream, FX_BOOL bReleaseStream);
+ virtual ~CFGAS_FileWrite();
+ virtual void Release() { delete this; }
+ virtual FX_FILESIZE GetSize();
+ virtual FX_BOOL Flush();
+ virtual FX_BOOL WriteBlock(const void* pData, size_t size);
+ virtual FX_BOOL WriteBlock(const void* pData,
+ FX_FILESIZE offset,
+ size_t size);
+
+ protected:
+ IFX_Stream* m_pStream;
+ FX_BOOL m_bReleaseStream;
+};
+
+} // namespace
IFX_Stream* IFX_Stream::CreateStream(IFX_BufferRead* pBufferRead,
FX_DWORD dwAccess,
diff --git a/xfa/src/fgas/include/fx_stm.h b/xfa/src/fgas/crt/fgas_stream.h
index 199a03f677..cc40a76cc6 100644
--- a/xfa/src/fgas/include/fx_stm.h
+++ b/xfa/src/fgas/crt/fgas_stream.h
@@ -4,10 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_STM_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_STM_H_
+#ifndef XFA_SRC_FGAS_CRT_FGAS_STREAM_H_
+#define XFA_SRC_FGAS_CRT_FGAS_STREAM_H_
#include "core/include/fxcrt/fx_stream.h"
+#include "core/include/fxcrt/fx_system.h"
class IFX_Stream;
@@ -27,11 +28,13 @@ enum FX_STREAMACCESS {
FX_STREAMACCESS_Append = 0x20,
FX_STREAMACCESS_Create = 0x80,
};
+
enum FX_STREAMSEEK {
FX_STREAMSEEK_Begin = 0,
FX_STREAMSEEK_Current,
FX_STREAMSEEK_End,
};
+
class IFX_Stream {
public:
static IFX_Stream* CreateStream(IFX_FileRead* pFileRead, FX_DWORD dwAccess);
@@ -72,4 +75,4 @@ class IFX_Stream {
int32_t iLength) = 0;
};
-#endif // XFA_SRC_FGAS_INCLUDE_FX_STM_H_
+#endif // XFA_SRC_FGAS_CRT_FGAS_STREAM_H_
diff --git a/xfa/src/fgas/src/crt/fx_system.cpp b/xfa/src/fgas/crt/fgas_system.cpp
index 43cccba20a..a4ca7546e0 100644
--- a/xfa/src/fgas/src/crt/fx_system.cpp
+++ b/xfa/src/fgas/crt/fgas_system.cpp
@@ -4,6 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "xfa/src/fgas/crt/fgas_system.h"
+
#include <algorithm>
#include "core/include/fxcrt/fx_system.h"
diff --git a/xfa/src/fgas/include/fx_sys.h b/xfa/src/fgas/crt/fgas_system.h
index d4fec2a74d..fb5a88efb5 100644
--- a/xfa/src/fgas/include/fx_sys.h
+++ b/xfa/src/fgas/crt/fgas_system.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_SYS_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_SYS_H_
+#ifndef XFA_SRC_FGAS_CRT_FGAS_SYSTEM_H_
+#define XFA_SRC_FGAS_CRT_FGAS_SYSTEM_H_
#include "core/include/fxcrt/fx_system.h"
@@ -20,4 +20,4 @@ int32_t FX_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count);
int32_t FX_filelength(FXSYS_FILE* file);
FX_BOOL FX_fsetsize(FXSYS_FILE* file, int32_t size);
-#endif // XFA_SRC_FGAS_INCLUDE_FX_SYS_H_
+#endif // XFA_SRC_FGAS_CRT_FGAS_SYSTEM_H_
diff --git a/xfa/src/fgas/src/crt/fx_utils.cpp b/xfa/src/fgas/crt/fgas_utils.cpp
index 382f64649f..8b3ed0aa0b 100644
--- a/xfa/src/fgas/src/crt/fx_utils.cpp
+++ b/xfa/src/fgas/crt/fgas_utils.cpp
@@ -4,11 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/src/fgas/src/crt/fx_utils.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
#include <algorithm>
-#include "xfa/src/fgas/include/fx_utl.h"
+#include "core/include/fxcrt/fx_basic.h"
class FX_BASEARRAYDATA : public CFX_Target {
public:
@@ -135,6 +135,7 @@ void CFX_BaseArray::RemoveAll(FX_BOOL bLeaveMemory) {
}
m_pData->iBlockCount = 0;
}
+
CFX_BaseMassArrayImp::CFX_BaseMassArrayImp(int32_t iChunkSize,
int32_t iBlockSize)
: m_iChunkSize(iChunkSize),
diff --git a/xfa/src/fgas/include/fx_utl.h b/xfa/src/fgas/crt/fgas_utils.h
index 8ce736569d..f52255a5d3 100644
--- a/xfa/src/fgas/include/fx_utl.h
+++ b/xfa/src/fgas/crt/fgas_utils.h
@@ -4,36 +4,16 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_UTL_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_UTL_H_
+#ifndef XFA_SRC_FGAS_CRT_FGAS_UTILS_H_
+#define XFA_SRC_FGAS_CRT_FGAS_UTILS_H_
-#include "core/include/fxcrt/fx_coordinates.h" // For CFX_Rect.
-#include "xfa/src/fgas/include/fx_mem.h"
+#include "core/include/fxcrt/fx_coordinates.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
+
+class FX_BASEARRAYDATA;
-class CFX_BaseArray;
-template <class baseType>
-class CFX_BaseArrayTemplate;
-template <class baseType>
-class CFX_ObjectBaseArrayTemplate;
-class CFX_BaseMassArray;
-class CFX_BaseMassArrayImp;
-template <class baseType>
-class CFX_MassArrayTemplate;
-template <class baseType>
-class CFX_ObjectMassArrayTemplate;
-class CFX_BaseDiscreteArray;
-template <class baseType>
-class CFX_DiscreteArrayTemplate;
-class CFX_BaseStack;
-template <class baseType>
-class CFX_StackTemplate;
-template <class baseType>
-class CFX_ObjectStackTemplate;
-template <class baseType>
-class CFX_CPLTreeNode;
template <class baseType>
class CFX_CPLTree;
-class FX_BASEARRAYDATA;
class CFX_BaseArray : public CFX_Target {
protected:
@@ -55,6 +35,7 @@ class CFX_BaseArray : public CFX_Target {
FX_BASEARRAYDATA* m_pData;
};
+
template <class baseType>
class CFX_BaseArrayTemplate : public CFX_BaseArray {
public:
@@ -105,6 +86,7 @@ class CFX_BaseArrayTemplate : public CFX_BaseArray {
typedef CFX_BaseArrayTemplate<void*> CFDE_PtrArray;
typedef CFX_BaseArrayTemplate<FX_DWORD> CFDE_DWordArray;
typedef CFX_BaseArrayTemplate<FX_WORD> CFDE_WordArray;
+
template <class baseType>
class CFX_ObjectBaseArrayTemplate : public CFX_BaseArray {
public:
@@ -204,6 +186,35 @@ class CFX_ObjectBaseArrayTemplate : public CFX_BaseArray {
CFX_BaseArray::RemoveAll(bLeaveMemory);
}
};
+
+class CFX_BaseMassArrayImp : public CFX_Target {
+ public:
+ CFX_BaseMassArrayImp(int32_t iChunkSize, int32_t iBlockSize);
+ ~CFX_BaseMassArrayImp();
+ uint8_t* AddSpace() { return AddSpaceTo(m_iBlockCount); }
+ uint8_t* AddSpaceTo(int32_t index);
+ uint8_t* GetAt(int32_t index) const;
+ int32_t Append(const CFX_BaseMassArrayImp& src,
+ int32_t iStart = 0,
+ int32_t iCount = -1);
+ int32_t Copy(const CFX_BaseMassArrayImp& src,
+ int32_t iStart = 0,
+ int32_t iCount = -1);
+ int32_t RemoveLast(int32_t iCount = -1);
+ void RemoveAll(FX_BOOL bLeaveMemory = FALSE);
+ int32_t m_iChunkSize;
+ int32_t m_iBlockSize;
+ int32_t m_iChunkCount;
+ int32_t m_iBlockCount;
+ CFX_PtrArray* m_pData;
+
+ protected:
+ void Append(int32_t iDstStart,
+ const CFX_BaseMassArrayImp& src,
+ int32_t iSrcStart = 0,
+ int32_t iSrcCount = -1);
+};
+
class CFX_BaseMassArray : public CFX_Target {
protected:
CFX_BaseMassArray(int32_t iChunkSize, int32_t iBlockSize);
@@ -221,6 +232,7 @@ class CFX_BaseMassArray : public CFX_Target {
void RemoveAll(FX_BOOL bLeaveMemory = FALSE);
CFX_BaseMassArrayImp* m_pData;
};
+
template <class baseType>
class CFX_MassArrayTemplate : public CFX_BaseMassArray {
public:
@@ -273,6 +285,7 @@ typedef CFX_MassArrayTemplate<FX_DWORD> CFX_DWordMassArray;
typedef CFX_MassArrayTemplate<FX_WORD> CFX_WordMassArray;
typedef CFX_MassArrayTemplate<CFX_Rect> CFX_RectMassArray;
typedef CFX_MassArrayTemplate<CFX_RectF> CFX_RectFMassArray;
+
template <class baseType>
class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray {
public:
@@ -354,6 +367,7 @@ class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray {
CFX_BaseMassArray::RemoveAll(bLeaveMemory);
}
};
+
class CFX_BaseDiscreteArray : public CFX_Target {
protected:
CFX_BaseDiscreteArray(int32_t iChunkSize, int32_t iBlockSize);
@@ -363,6 +377,7 @@ class CFX_BaseDiscreteArray : public CFX_Target {
void RemoveAll();
void* m_pData;
};
+
template <class baseType>
class CFX_DiscreteArrayTemplate : public CFX_BaseDiscreteArray {
public:
@@ -383,6 +398,7 @@ class CFX_DiscreteArrayTemplate : public CFX_BaseDiscreteArray {
typedef CFX_DiscreteArrayTemplate<void*> CFX_PtrDiscreteArray;
typedef CFX_DiscreteArrayTemplate<FX_DWORD> CFX_DWordDiscreteArray;
typedef CFX_DiscreteArrayTemplate<FX_WORD> CFX_WordDiscreteArray;
+
class CFX_BaseStack : public CFX_Target {
protected:
CFX_BaseStack(int32_t iChunkSize, int32_t iBlockSize);
@@ -395,6 +411,7 @@ class CFX_BaseStack : public CFX_Target {
void RemoveAll(FX_BOOL bLeaveMemory = FALSE);
CFX_BaseMassArrayImp* m_pData;
};
+
template <class baseType>
class CFX_StackTemplate : public CFX_BaseStack {
public:
@@ -421,6 +438,7 @@ typedef CFX_StackTemplate<void*> CFX_PtrStack;
typedef CFX_StackTemplate<FX_DWORD> CFX_DWordStack;
typedef CFX_StackTemplate<FX_WORD> CFX_WordStack;
typedef CFX_StackTemplate<int32_t> CFX_Int32Stack;
+
template <class baseType>
class CFX_ObjectStackTemplate : public CFX_BaseStack {
public:
@@ -476,6 +494,7 @@ class CFX_ObjectStackTemplate : public CFX_BaseStack {
return CFX_BaseStack::GetSize();
}
};
+
template <class baseType>
class CFX_CPLTreeNode : public CFX_Target {
public:
@@ -676,6 +695,7 @@ class CFX_CPLTreeNode : public CFX_Target {
baseType m_Data;
friend class CFX_CPLTree<baseType>;
};
+
template <class baseType>
class CFX_CPLTree {
public:
@@ -714,4 +734,4 @@ class CFX_CPLTree {
CPLTreeNode m_Root;
};
-#endif // XFA_SRC_FGAS_INCLUDE_FX_UTL_H_
+#endif // XFA_SRC_FGAS_CRT_FGAS_UTILS_H_
diff --git a/xfa/src/fgas/include/fx_fnt.h b/xfa/src/fgas/font/fgas_font.h
index 3d44eaa8d4..0484dee3e6 100644
--- a/xfa/src/fgas/include/fx_fnt.h
+++ b/xfa/src/fgas/font/fgas_font.h
@@ -4,15 +4,15 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_FNT_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_FNT_H_
+#ifndef XFA_SRC_FGAS_FONT_FGAS_FONT_H_
+#define XFA_SRC_FGAS_FONT_FGAS_FONT_H_
#include "core/include/fxge/fx_font.h"
-#include "xfa/src/fgas/include/fx_stm.h"
+#include "xfa/src/fgas/crt/fgas_stream.h"
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-#include "xfa/src/fgas/include/fx_mem.h"
-#include "xfa/src/fgas/include/fx_utl.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
class IFX_Font;
@@ -282,4 +282,4 @@ class IFX_FontMgr {
};
#endif
-#endif // XFA_SRC_FGAS_INCLUDE_FX_FNT_H_
+#endif // XFA_SRC_FGAS_FONT_FGAS_FONT_H_
diff --git a/xfa/src/fgas/src/font/fx_fontutils.cpp b/xfa/src/fgas/font/fgas_fontutils.cpp
index 5499994eef..62f26f515a 100644
--- a/xfa/src/fgas/src/font/fx_fontutils.cpp
+++ b/xfa/src/fgas/font/fgas_fontutils.cpp
@@ -4,10 +4,10 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/src/fgas/src/font/fx_fontutils.h"
+#include "xfa/src/fgas/font/fgas_fontutils.h"
#include "core/include/fxcrt/fx_ext.h"
-#include "xfa/src/fgas/include/fx_fnt.h"
+#include "xfa/src/fgas/font/fgas_font.h"
FX_DWORD FGAS_GetFontHashCode(FX_WORD wCodePage, FX_DWORD dwFontStyles) {
FX_DWORD dwHash = wCodePage;
diff --git a/xfa/src/fgas/src/font/fx_fontutils.h b/xfa/src/fgas/font/fgas_fontutils.h
index ec14686c8e..4cceb68574 100644
--- a/xfa/src/fgas/src/font/fx_fontutils.h
+++ b/xfa/src/fgas/font/fgas_fontutils.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_SRC_FONT_FX_FONTUTILS_H_
-#define XFA_SRC_FGAS_SRC_FONT_FX_FONTUTILS_H_
+#ifndef XFA_SRC_FGAS_FONT_FGAS_FONTUTILS_H_
+#define XFA_SRC_FGAS_FONT_FGAS_FONTUTILS_H_
#include "core/include/fxcrt/fx_string.h"
@@ -22,4 +22,4 @@ FX_DWORD FGAS_GetFontFamilyHash(const FX_WCHAR* pszFontFamily,
FX_WORD wCodePage);
const FGAS_FONTUSB* FGAS_GetUnicodeBitField(FX_WCHAR wUnicode);
-#endif // XFA_SRC_FGAS_SRC_FONT_FX_FONTUTILS_H_
+#endif // XFA_SRC_FGAS_FONT_FGAS_FONTUTILS_H_
diff --git a/xfa/src/fgas/src/font/fx_gefont.cpp b/xfa/src/fgas/font/fgas_gefont.cpp
index 468e28ea96..df614a57c3 100644
--- a/xfa/src/fgas/src/font/fx_gefont.cpp
+++ b/xfa/src/fgas/font/fgas_gefont.cpp
@@ -4,10 +4,10 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/src/fgas/src/font/fx_gefont.h"
+#include "xfa/src/fgas/font/fgas_gefont.h"
-#include "xfa/src/fgas/include/fx_cpg.h"
-#include "xfa/src/fgas/src/font/fx_fontutils.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
+#include "xfa/src/fgas/font/fgas_fontutils.h"
IFX_Font* IFX_Font::LoadFont(const FX_WCHAR* pszFontFamily,
FX_DWORD dwFontStyles,
diff --git a/xfa/src/fgas/src/font/fx_gefont.h b/xfa/src/fgas/font/fgas_gefont.h
index ef7803d2a5..1bc8a6a902 100644
--- a/xfa/src/fgas/src/font/fx_gefont.h
+++ b/xfa/src/fgas/font/fgas_gefont.h
@@ -4,11 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_SRC_FONT_FX_GEFONT_H_
-#define XFA_SRC_FGAS_SRC_FONT_FX_GEFONT_H_
+#ifndef XFA_SRC_FGAS_FONT_FGAS_GEFONT_H_
+#define XFA_SRC_FGAS_FONT_FGAS_GEFONT_H_
-#include "xfa/src/fgas/include/fx_fnt.h"
-#include "xfa/src/fgas/include/fx_utl.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
+#include "xfa/src/fgas/font/fgas_font.h"
#define FXFONT_SUBST_ITALIC 0x02
@@ -89,4 +89,4 @@ class CFX_GEFont : public IFX_Font {
FX_BOOL bCharCode = FALSE);
};
-#endif // XFA_SRC_FGAS_SRC_FONT_FX_GEFONT_H_
+#endif // XFA_SRC_FGAS_FONT_FGAS_GEFONT_H_
diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp b/xfa/src/fgas/font/fgas_stdfontmgr.cpp
index 8ec8fc51fe..99f1fdda44 100644
--- a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp
+++ b/xfa/src/fgas/font/fgas_stdfontmgr.cpp
@@ -4,11 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/src/fgas/src/font/fx_stdfontmgr.h"
+#include "xfa/src/fgas/font/fgas_stdfontmgr.h"
#include "core/include/fxcrt/fx_stream.h"
-#include "xfa/src/fgas/include/fx_cpg.h"
-#include "xfa/src/fgas/src/font/fx_fontutils.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
+#include "xfa/src/fgas/font/fgas_fontutils.h"
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
IFX_FontMgr* IFX_FontMgr::Create(FX_LPEnumAllFonts pEnumerator,
diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.h b/xfa/src/fgas/font/fgas_stdfontmgr.h
index d1cc095805..cf16033919 100644
--- a/xfa/src/fgas/src/font/fx_stdfontmgr.h
+++ b/xfa/src/fgas/font/fgas_stdfontmgr.h
@@ -4,14 +4,14 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_SRC_FONT_FX_STDFONTMGR_H_
-#define XFA_SRC_FGAS_SRC_FONT_FX_STDFONTMGR_H_
+#ifndef XFA_SRC_FGAS_FONT_FGAS_STDFONTMGR_H_
+#define XFA_SRC_FGAS_FONT_FGAS_STDFONTMGR_H_
#include "core/include/fxcrt/fx_ext.h"
#include "core/include/fxge/fx_freetype.h"
#include "core/include/fxge/fx_ge.h"
#include "third_party/freetype/include/freetype/fttypes.h"
-#include "xfa/src/fgas/include/fx_fnt.h"
+#include "xfa/src/fgas/font/fgas_font.h"
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
int32_t FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles);
@@ -249,4 +249,4 @@ class CFX_FontMgrImp : public IFX_FontMgr {
};
#endif
-#endif // XFA_SRC_FGAS_SRC_FONT_FX_STDFONTMGR_H_
+#endif // XFA_SRC_FGAS_FONT_FGAS_STDFONTMGR_H_
diff --git a/xfa/src/fgas/src/layout/fx_linebreak.cpp b/xfa/src/fgas/layout/fgas_linebreak.cpp
index ed3c1b57f3..b43b8007b4 100644
--- a/xfa/src/fgas/src/layout/fx_linebreak.cpp
+++ b/xfa/src/fgas/layout/fgas_linebreak.cpp
@@ -4,8 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "xfa/src/fgas/layout/fgas_linebreak.h"
+
#include "core/include/fxcrt/fx_ucd.h"
-#include "xfa/src/fgas/include/fx_lbk.h"
const FX_LINEBREAKTYPE gs_FX_LineBreak_PairTable[64][32] = {
{FX_LBPB, FX_LBPB, FX_LBPB, FX_LBPB, FX_LBPB, FX_LBPB, FX_LBPB, FX_LBPB,
diff --git a/xfa/src/fgas/include/fx_lbk.h b/xfa/src/fgas/layout/fgas_linebreak.h
index 12a0fc1cad..7b91124bc2 100644
--- a/xfa/src/fgas/include/fx_lbk.h
+++ b/xfa/src/fgas/layout/fgas_linebreak.h
@@ -4,11 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_LBK_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_LBK_H_
+#ifndef XFA_SRC_FGAS_LAYOUT_FGAS_LINEBREAK_H_
+#define XFA_SRC_FGAS_LAYOUT_FGAS_LINEBREAK_H_
#include "core/include/fxcrt/fx_system.h"
-#include "xfa/src/fgas/include/fx_utl.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
enum FX_LINEBREAKTYPE {
FX_LBT_UNKNOWN = 0x00,
@@ -37,4 +37,4 @@ void FX_GetLineBreakPositions(const FX_WCHAR* pwsText,
int32_t iLength,
CFX_Int32MassArray& bp);
-#endif // XFA_SRC_FGAS_INCLUDE_FX_LBK_H_
+#endif // XFA_SRC_FGAS_LAYOUT_FGAS_LINEBREAK_H_
diff --git a/xfa/src/fgas/src/layout/fx_rtfbreak.cpp b/xfa/src/fgas/layout/fgas_rtfbreak.cpp
index b1f9d5e9ae..7e4ab4c08c 100644
--- a/xfa/src/fgas/src/layout/fx_rtfbreak.cpp
+++ b/xfa/src/fgas/layout/fgas_rtfbreak.cpp
@@ -4,12 +4,179 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/src/fgas/src/layout/fx_rtfbreak.h"
+#include "xfa/src/fgas/layout/fgas_rtfbreak.h"
#include <algorithm>
-#include "xfa/src/fgas/include/fx_lbk.h"
-#include "xfa/src/fgas/src/layout/fx_unicode.h"
+#include "core/include/fxcrt/fx_arb.h"
+#include "xfa/src/fgas/layout/fgas_linebreak.h"
+#include "xfa/src/fgas/layout/fgas_unicode.h"
+
+namespace {
+
+class CFX_RTFLine {
+ public:
+ CFX_RTFLine()
+ : m_LinePieces(16),
+ m_iStart(0),
+ m_iWidth(0),
+ m_iArabicChars(0),
+ m_iMBCSChars(0) {}
+ ~CFX_RTFLine() { RemoveAll(); }
+ int32_t CountChars() const { return m_LineChars.GetSize(); }
+ CFX_RTFChar& GetChar(int32_t index) {
+ FXSYS_assert(index > -1 && index < m_LineChars.GetSize());
+ return *m_LineChars.GetDataPtr(index);
+ }
+ CFX_RTFChar* GetCharPtr(int32_t index) {
+ FXSYS_assert(index > -1 && index < m_LineChars.GetSize());
+ return m_LineChars.GetDataPtr(index);
+ }
+ int32_t CountPieces() const { return m_LinePieces.GetSize(); }
+ CFX_RTFPiece& GetPiece(int32_t index) const {
+ FXSYS_assert(index > -1 && index < m_LinePieces.GetSize());
+ return m_LinePieces.GetAt(index);
+ }
+ CFX_RTFPiece* GetPiecePtr(int32_t index) const {
+ FXSYS_assert(index > -1 && index < m_LinePieces.GetSize());
+ return m_LinePieces.GetPtrAt(index);
+ }
+ int32_t GetLineEnd() const { return m_iStart + m_iWidth; }
+ void RemoveAll(FX_BOOL bLeaveMemory = FALSE) {
+ CFX_RTFChar* pChar;
+ IFX_Unknown* pUnknown;
+ int32_t iCount = m_LineChars.GetSize();
+ for (int32_t i = 0; i < iCount; i++) {
+ pChar = m_LineChars.GetDataPtr(i);
+ if ((pUnknown = pChar->m_pUserData) != NULL) {
+ pUnknown->Release();
+ }
+ }
+ m_LineChars.RemoveAll();
+ m_LinePieces.RemoveAll(bLeaveMemory);
+ m_iWidth = 0;
+ m_iArabicChars = 0;
+ m_iMBCSChars = 0;
+ }
+ CFX_RTFCharArray m_LineChars;
+ CFX_RTFPieceArray m_LinePieces;
+ int32_t m_iStart;
+ int32_t m_iWidth;
+ int32_t m_iArabicChars;
+ int32_t m_iMBCSChars;
+};
+
+class CFX_RTFBreak : public IFX_RTFBreak {
+ public:
+ CFX_RTFBreak(FX_DWORD dwPolicies);
+ ~CFX_RTFBreak();
+ void Release() override { delete this; }
+ void SetLineBoundary(FX_FLOAT fLineStart, FX_FLOAT fLineEnd) override;
+ void SetLineStartPos(FX_FLOAT fLinePos) override;
+ FX_DWORD GetLayoutStyles() const override { return m_dwLayoutStyles; }
+ void SetLayoutStyles(FX_DWORD dwLayoutStyles) override;
+ void SetFont(IFX_Font* pFont) override;
+ void SetFontSize(FX_FLOAT fFontSize) override;
+ void SetTabWidth(FX_FLOAT fTabWidth) override;
+ void AddPositionedTab(FX_FLOAT fTabPos) override;
+ void SetPositionedTabs(const CFX_FloatArray& tabs) override;
+ void ClearPositionedTabs() override;
+ void SetDefaultChar(FX_WCHAR wch) override;
+ void SetLineBreakChar(FX_WCHAR wch) override;
+ void SetLineBreakTolerance(FX_FLOAT fTolerance) override;
+ void SetHorizontalScale(int32_t iScale) override;
+ void SetVerticalScale(int32_t iScale) override;
+ void SetCharRotation(int32_t iCharRotation) override;
+ void SetCharSpace(FX_FLOAT fCharSpace) override;
+ void SetWordSpace(FX_BOOL bDefault, FX_FLOAT fWordSpace) override;
+ void SetReadingOrder(FX_BOOL bRTL = FALSE) override;
+ void SetAlignment(int32_t iAlignment = FX_RTFLINEALIGNMENT_Left) override;
+ void SetUserData(IFX_Unknown* pUserData) override;
+ FX_DWORD AppendChar(FX_WCHAR wch) override;
+ FX_DWORD EndBreak(FX_DWORD dwStatus = FX_RTFBREAK_PieceBreak) override;
+ int32_t CountBreakPieces() const override;
+ const CFX_RTFPiece* GetBreakPiece(int32_t index) const override;
+ void GetLineRect(CFX_RectF& rect) const override;
+ void ClearBreakPieces() override;
+ void Reset() override;
+ int32_t GetDisplayPos(
+ const FX_RTFTEXTOBJ* pText,
+ FXTEXT_CHARPOS* pCharPos,
+ FX_BOOL bCharCode = FALSE,
+ CFX_WideString* pWSForms = NULL,
+ FX_AdjustCharDisplayPos pAdjustPos = NULL) const override;
+ int32_t GetCharRects(const FX_RTFTEXTOBJ* pText,
+ CFX_RectFArray& rtArray,
+ FX_BOOL bCharBBox = FALSE) const override;
+ FX_DWORD AppendChar_CharCode(FX_WCHAR wch);
+ FX_DWORD AppendChar_Combination(CFX_RTFChar* pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Tab(CFX_RTFChar* pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Control(CFX_RTFChar* pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Arabic(CFX_RTFChar* pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Others(CFX_RTFChar* pCurChar, int32_t iRotation);
+
+ protected:
+ FX_DWORD m_dwPolicies;
+ IFX_ArabicChar* m_pArabicChar;
+ int32_t m_iBoundaryStart;
+ int32_t m_iBoundaryEnd;
+ FX_DWORD m_dwLayoutStyles;
+ FX_BOOL m_bPagination;
+ FX_BOOL m_bVertical;
+ FX_BOOL m_bSingleLine;
+ FX_BOOL m_bCharCode;
+ IFX_Font* m_pFont;
+ int32_t m_iFontHeight;
+ int32_t m_iFontSize;
+ int32_t m_iTabWidth;
+ CFX_Int32Array m_PositionedTabs;
+ FX_BOOL m_bOrphanLine;
+ FX_WCHAR m_wDefChar;
+ int32_t m_iDefChar;
+ FX_WCHAR m_wLineBreakChar;
+ int32_t m_iHorizontalScale;
+ int32_t m_iVerticalScale;
+ int32_t m_iLineRotation;
+ int32_t m_iCharRotation;
+ int32_t m_iRotation;
+ int32_t m_iCharSpace;
+ FX_BOOL m_bWordSpace;
+ int32_t m_iWordSpace;
+ FX_BOOL m_bRTL;
+ int32_t m_iAlignment;
+ IFX_Unknown* m_pUserData;
+ FX_DWORD m_dwCharType;
+ FX_DWORD m_dwIdentity;
+ CFX_RTFLine m_RTFLine1;
+ CFX_RTFLine m_RTFLine2;
+ CFX_RTFLine* m_pCurLine;
+ int32_t m_iReady;
+ int32_t m_iTolerance;
+ int32_t GetLineRotation(FX_DWORD dwStyles) const;
+ void SetBreakStatus();
+ CFX_RTFChar* GetLastChar(int32_t index) const;
+ CFX_RTFLine* GetRTFLine(FX_BOOL bReady) const;
+ CFX_RTFPieceArray* GetRTFPieces(FX_BOOL bReady) const;
+ FX_DWORD GetUnifiedCharType(FX_DWORD dwType) const;
+ int32_t GetLastPositionedTab() const;
+ FX_BOOL GetPositionedTab(int32_t& iTabPos) const;
+ int32_t GetBreakPos(CFX_RTFCharArray& tca,
+ int32_t& iEndPos,
+ FX_BOOL bAllChars = FALSE,
+ FX_BOOL bOnlyBrk = FALSE);
+ void SplitTextLine(CFX_RTFLine* pCurLine,
+ CFX_RTFLine* pNextLine,
+ FX_BOOL bAllChars = FALSE);
+ FX_BOOL EndBreak_SplitLine(CFX_RTFLine* pNextLine,
+ FX_BOOL bAllChars,
+ FX_DWORD dwStatus);
+ void EndBreak_BidiLine(CFX_TPOArray& tpos, FX_DWORD dwStatus);
+ void EndBreak_Alignment(CFX_TPOArray& tpos,
+ FX_BOOL bAllChars,
+ FX_DWORD dwStatus);
+};
+
+} // namespace
IFX_RTFBreak* IFX_RTFBreak::Create(FX_DWORD dwPolicies) {
return new CFX_RTFBreak(dwPolicies);
diff --git a/xfa/src/fgas/include/fx_rbk.h b/xfa/src/fgas/layout/fgas_rtfbreak.h
index ef76ab6243..24cf2e32cb 100644
--- a/xfa/src/fgas/include/fx_rbk.h
+++ b/xfa/src/fgas/layout/fgas_rtfbreak.h
@@ -4,19 +4,18 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_RBK_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_RBK_H_
+#ifndef XFA_SRC_FGAS_LAYOUT_FGAS_RTFBREAK_H_
+#define XFA_SRC_FGAS_LAYOUT_FGAS_RTFBREAK_H_
#include "core/include/fxcrt/fx_ucd.h"
#include "core/include/fxge/fx_ge.h"
-#include "xfa/src/fgas/include/fx_mem.h"
-#include "xfa/src/fgas/include/fx_tbk.h"
-#include "xfa/src/fgas/include/fx_ucd.h"
-#include "xfa/src/fgas/include/fx_utl.h"
+#include "xfa/src/fgas/crt/fgas_memory.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
+#include "xfa/src/fgas/layout/fgas_textbreak.h"
+#include "xfa/src/fgas/layout/fgas_unicode.h"
class IFX_Unknown;
class IFX_Font;
-class IFX_RTFBreak;
#define FX_RTFBREAKPOLICY_None 0x00
#define FX_RTFBREAKPOLICY_SpaceBreak 0x01
@@ -190,6 +189,7 @@ class CFX_RTFPiece : public CFX_Target {
IFX_Unknown* m_pUserData;
};
typedef CFX_BaseArrayTemplate<CFX_RTFPiece> CFX_RTFPieceArray;
+
class IFX_RTFBreak {
public:
static IFX_RTFBreak* Create(FX_DWORD dwPolicies);
@@ -234,4 +234,4 @@ class IFX_RTFBreak {
FX_BOOL bCharBBox = FALSE) const = 0;
};
-#endif // XFA_SRC_FGAS_INCLUDE_FX_RBK_H_
+#endif // XFA_SRC_FGAS_LAYOUT_FGAS_RTFBREAK_H_
diff --git a/xfa/src/fgas/src/layout/fx_textbreak.cpp b/xfa/src/fgas/layout/fgas_textbreak.cpp
index 6263463bd4..af7be50a51 100644
--- a/xfa/src/fgas/src/layout/fx_textbreak.cpp
+++ b/xfa/src/fgas/layout/fgas_textbreak.cpp
@@ -4,13 +4,176 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/src/fgas/src/layout/fx_textbreak.h"
+#include "xfa/src/fgas/layout/fgas_textbreak.h"
#include <algorithm>
#include "core/include/fxcrt/fx_arb.h"
-#include "xfa/src/fgas/include/fx_lbk.h"
-#include "xfa/src/fgas/src/layout/fx_unicode.h"
+#include "core/include/fxcrt/fx_memory.h"
+#include "xfa/src/fgas/layout/fgas_linebreak.h"
+#include "xfa/src/fgas/layout/fgas_unicode.h"
+
+namespace {
+
+class CFX_TxtLine {
+ public:
+ CFX_TxtLine(int32_t iBlockSize)
+ : m_iStart(0), m_iWidth(0), m_iArabicChars(0) {
+ m_pLineChars = new CFX_TxtCharArray;
+ m_pLinePieces = new CFX_TxtPieceArray(16);
+ }
+ ~CFX_TxtLine() {
+ RemoveAll();
+ delete m_pLineChars;
+ delete m_pLinePieces;
+ }
+ int32_t CountChars() const { return m_pLineChars->GetSize(); }
+ CFX_TxtChar* GetCharPtr(int32_t index) const {
+ FXSYS_assert(index > -1 && index < m_pLineChars->GetSize());
+ return m_pLineChars->GetDataPtr(index);
+ }
+ int32_t CountPieces() const { return m_pLinePieces->GetSize(); }
+ CFX_TxtPiece* GetPiecePtr(int32_t index) const {
+ FXSYS_assert(index > -1 && index < m_pLinePieces->GetSize());
+ return m_pLinePieces->GetPtrAt(index);
+ }
+ void GetString(CFX_WideString& wsStr) const {
+ int32_t iCount = m_pLineChars->GetSize();
+ FX_WCHAR* pBuf = wsStr.GetBuffer(iCount);
+ CFX_Char* pChar;
+ for (int32_t i = 0; i < iCount; i++) {
+ pChar = m_pLineChars->GetDataPtr(i);
+ *pBuf++ = (FX_WCHAR)pChar->m_wCharCode;
+ }
+ wsStr.ReleaseBuffer(iCount);
+ }
+ void RemoveAll(FX_BOOL bLeaveMemory = FALSE) {
+ m_pLineChars->RemoveAll();
+ m_pLinePieces->RemoveAll(bLeaveMemory);
+ m_iWidth = 0;
+ m_iArabicChars = 0;
+ }
+ CFX_TxtCharArray* m_pLineChars;
+ CFX_TxtPieceArray* m_pLinePieces;
+ int32_t m_iStart;
+ int32_t m_iWidth;
+ int32_t m_iArabicChars;
+};
+
+class CFX_TxtBreak : public IFX_TxtBreak {
+ public:
+ CFX_TxtBreak(FX_DWORD dwPolicies);
+ ~CFX_TxtBreak();
+ virtual void Release() { delete this; }
+ virtual void SetLineWidth(FX_FLOAT fLineWidth);
+ virtual void SetLinePos(FX_FLOAT fLinePos);
+ virtual FX_DWORD GetLayoutStyles() const { return m_dwLayoutStyles; }
+ virtual void SetLayoutStyles(FX_DWORD dwLayoutStyles);
+ virtual void SetFont(IFX_Font* pFont);
+ virtual void SetFontSize(FX_FLOAT fFontSize);
+ virtual void SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant);
+ virtual void SetDefaultChar(FX_WCHAR wch);
+ virtual void SetParagraphBreakChar(FX_WCHAR wch);
+ virtual void SetLineBreakTolerance(FX_FLOAT fTolerance);
+ virtual void SetHorizontalScale(int32_t iScale);
+ virtual void SetVerticalScale(int32_t iScale);
+ virtual void SetCharRotation(int32_t iCharRotation);
+ virtual void SetCharSpace(FX_FLOAT fCharSpace);
+ virtual void SetAlignment(int32_t iAlignment);
+ virtual FX_DWORD GetContextCharStyles() const;
+ virtual void SetContextCharStyles(FX_DWORD dwCharStyles);
+ virtual void SetCombWidth(FX_FLOAT fCombWidth);
+ virtual void SetUserData(void* pUserData);
+ virtual FX_DWORD AppendChar(FX_WCHAR wch);
+ virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_TXTBREAK_PieceBreak);
+ virtual int32_t CountBreakChars() const;
+ virtual int32_t CountBreakPieces() const;
+ virtual const CFX_TxtPiece* GetBreakPiece(int32_t index) const;
+ virtual void ClearBreakPieces();
+ virtual void Reset();
+ virtual int32_t GetDisplayPos(
+ const FX_TXTRUN* pTxtRun,
+ FXTEXT_CHARPOS* pCharPos,
+ FX_BOOL bCharCode = FALSE,
+ CFX_WideString* pWSForms = NULL,
+ FX_AdjustCharDisplayPos pAdjustPos = NULL) const;
+ virtual int32_t GetCharRects(const FX_TXTRUN* pTxtRun,
+ CFX_RectFArray& rtArray,
+ FX_BOOL bCharBBox = FALSE) const;
+ void AppendChar_PageLoad(CFX_Char* pCurChar, FX_DWORD dwProps);
+ FX_DWORD AppendChar_Combination(CFX_Char* pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Tab(CFX_Char* pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Control(CFX_Char* pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Arabic(CFX_Char* pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Others(CFX_Char* pCurChar, int32_t iRotation);
+
+ protected:
+ FX_DWORD m_dwPolicies;
+ FX_BOOL m_bPagination;
+ IFX_ArabicChar* m_pArabicChar;
+ int32_t m_iLineWidth;
+ FX_DWORD m_dwLayoutStyles;
+ FX_BOOL m_bVertical;
+ FX_BOOL m_bArabicContext;
+ FX_BOOL m_bArabicShapes;
+ FX_BOOL m_bRTL;
+ FX_BOOL m_bSingleLine;
+ FX_BOOL m_bCombText;
+ int32_t m_iArabicContext;
+ int32_t m_iCurArabicContext;
+ IFX_Font* m_pFont;
+ int32_t m_iFontSize;
+ FX_BOOL m_bEquidistant;
+ int32_t m_iTabWidth;
+ FX_WCHAR m_wDefChar;
+ FX_WCHAR m_wParagBreakChar;
+ int32_t m_iDefChar;
+ int32_t m_iLineRotation;
+ int32_t m_iCharRotation;
+ int32_t m_iRotation;
+ int32_t m_iAlignment;
+ FX_DWORD m_dwContextCharStyles;
+ int32_t m_iCombWidth;
+ void* m_pUserData;
+ FX_DWORD m_dwCharType;
+ FX_BOOL m_bCurRTL;
+ int32_t m_iCurAlignment;
+ FX_BOOL m_bArabicNumber;
+ FX_BOOL m_bArabicComma;
+ CFX_TxtLine* m_pTxtLine1;
+ CFX_TxtLine* m_pTxtLine2;
+ CFX_TxtLine* m_pCurLine;
+ int32_t m_iReady;
+ int32_t m_iTolerance;
+ int32_t m_iHorScale;
+ int32_t m_iVerScale;
+ int32_t m_iCharSpace;
+ void SetBreakStatus();
+ int32_t GetLineRotation(FX_DWORD dwStyles) const;
+ CFX_TxtChar* GetLastChar(int32_t index, FX_BOOL bOmitChar = TRUE) const;
+ CFX_TxtLine* GetTxtLine(FX_BOOL bReady) const;
+ CFX_TxtPieceArray* GetTxtPieces(FX_BOOL bReady) const;
+ FX_DWORD GetUnifiedCharType(FX_DWORD dwType) const;
+ void ResetArabicContext();
+ void ResetContextCharStyles();
+ void EndBreak_UpdateArabicShapes();
+ FX_BOOL EndBreak_SplitLine(CFX_TxtLine* pNextLine,
+ FX_BOOL bAllChars,
+ FX_DWORD dwStatus);
+ void EndBreak_BidiLine(CFX_TPOArray& tpos, FX_DWORD dwStatus);
+ void EndBreak_Alignment(CFX_TPOArray& tpos,
+ FX_BOOL bAllChars,
+ FX_DWORD dwStatus);
+ int32_t GetBreakPos(CFX_TxtCharArray& ca,
+ int32_t& iEndPos,
+ FX_BOOL bAllChars = FALSE,
+ FX_BOOL bOnlyBrk = FALSE);
+ void SplitTextLine(CFX_TxtLine* pCurLine,
+ CFX_TxtLine* pNextLine,
+ FX_BOOL bAllChars = FALSE);
+};
+
+} // namespace
extern const FX_LINEBREAKTYPE gs_FX_LineBreak_PairTable[64][32];
IFX_TxtBreak* IFX_TxtBreak::Create(FX_DWORD dwPolicies) {
diff --git a/xfa/src/fgas/include/fx_tbk.h b/xfa/src/fgas/layout/fgas_textbreak.h
index aa207a568f..65fba720d5 100644
--- a/xfa/src/fgas/include/fx_tbk.h
+++ b/xfa/src/fgas/layout/fgas_textbreak.h
@@ -4,13 +4,13 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_TBK_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_TBK_H_
+#ifndef XFA_SRC_FGAS_LAYOUT_FGAS_TEXTBREAK_H_
+#define XFA_SRC_FGAS_LAYOUT_FGAS_TEXTBREAK_H_
#include "core/include/fxcrt/fx_ucd.h"
#include "core/include/fxge/fx_ge.h"
-#include "xfa/src/fgas/include/fx_ucd.h"
-#include "xfa/src/fgas/include/fx_utl.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
+#include "xfa/src/fgas/layout/fgas_unicode.h"
class IFX_Font;
class CFX_Char;
@@ -176,6 +176,7 @@ class CFX_TxtPiece : public CFX_Target {
void* m_pUserData;
};
typedef CFX_BaseArrayTemplate<CFX_TxtPiece> CFX_TxtPieceArray;
+
class IFX_TxtBreak {
public:
static IFX_TxtBreak* Create(FX_DWORD dwPolicies);
@@ -218,4 +219,4 @@ class IFX_TxtBreak {
FX_BOOL bCharBBox = FALSE) const = 0;
};
-#endif // XFA_SRC_FGAS_INCLUDE_FX_TBK_H_
+#endif // XFA_SRC_FGAS_LAYOUT_FGAS_TEXTBREAK_H_
diff --git a/xfa/src/fgas/src/layout/fx_unicode.cpp b/xfa/src/fgas/layout/fgas_unicode.cpp
index 8b9546e051..f463d753b5 100644
--- a/xfa/src/fgas/src/layout/fx_unicode.cpp
+++ b/xfa/src/fgas/layout/fgas_unicode.cpp
@@ -4,9 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/src/fgas/src/layout/fx_unicode.h"
-
-#include "xfa/src/fgas/include/fx_ucd.h"
+#include "xfa/src/fgas/layout/fgas_unicode.h"
void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray& tpos, int32_t iStart, int32_t iEnd) {
FXSYS_assert(iStart > -1 && iStart < tpos.GetSize());
diff --git a/xfa/src/fgas/include/fx_ucd.h b/xfa/src/fgas/layout/fgas_unicode.h
index 1d86562473..f25da87e96 100644
--- a/xfa/src/fgas/include/fx_ucd.h
+++ b/xfa/src/fgas/layout/fgas_unicode.h
@@ -4,10 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_UCD_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_UCD_H_
+#ifndef XFA_SRC_FGAS_LAYOUT_FGAS_UNICODE_H_
+#define XFA_SRC_FGAS_LAYOUT_FGAS_UNICODE_H_
-#include "xfa/src/fgas/include/fx_fnt.h"
+#include "xfa/src/fgas/font/fgas_font.h"
+#include "xfa/src/fgas/crt/fgas_utils.h"
#define FX_JAPCHARPROPERTYEX_Left 0x01
#define FX_JAPCHARPROPERTYEX_Center 0x02
@@ -16,6 +17,14 @@
#define FX_JAPCHARPROPERTYEX_Middle 0x20
#define FX_JAPCHARPROPERTYEX_Bottom 0x30
+struct FX_TPO {
+ int32_t index;
+ int32_t pos;
+};
+typedef CFX_MassArrayTemplate<FX_TPO> CFX_TPOArray;
+
+void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray& tpos, int32_t iStart, int32_t iEnd);
+
struct FX_JAPCHARPROPERTYEX {
FX_WCHAR wChar;
uint8_t uAlign;
@@ -35,4 +44,4 @@ FX_BOOL FX_AdjustJapCharDisplayPos(FX_WCHAR wch,
FX_BOOL bVertical,
CFX_PointF& ptOffset);
-#endif // XFA_SRC_FGAS_INCLUDE_FX_UCD_H_
+#endif // XFA_SRC_FGAS_LAYOUT_FGAS_UNICODE_H_
diff --git a/xfa/src/fgas/src/localization/fx_datetime.cpp b/xfa/src/fgas/localization/fgas_datetime.cpp
index 536f19e30e..e803b490d6 100644
--- a/xfa/src/fgas/src/localization/fx_datetime.cpp
+++ b/xfa/src/fgas/localization/fgas_datetime.cpp
@@ -5,7 +5,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "core/include/fxcrt/fx_system.h"
-#include "xfa/src/fgas/include/fx_datetime.h"
+#include "xfa/src/fgas/localization/fgas_datetime.h"
#if _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_ || \
_FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_
diff --git a/xfa/src/fgas/include/fx_datetime.h b/xfa/src/fgas/localization/fgas_datetime.h
index fa1ff6e16a..5dd70ccc65 100644
--- a/xfa/src/fgas/include/fx_datetime.h
+++ b/xfa/src/fgas/localization/fgas_datetime.h
@@ -4,13 +4,14 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_DATETIME_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_DATETIME_H_
+#ifndef XFA_SRC_FGAS_LOCALIZATION_FGAS_DATETIME_H_
+#define XFA_SRC_FGAS_LOCALIZATION_FGAS_DATETIME_H_
#include "core/include/fxcrt/fx_system.h"
class CFX_Unitime;
class CFX_DateTime;
+
typedef int64_t FX_UNITIME;
enum FX_WEEKDAY {
FX_Sunday = 0,
@@ -21,9 +22,11 @@ enum FX_WEEKDAY {
FX_Friday,
FX_Saturday,
};
+
FX_BOOL FX_IsLeapYear(int32_t iYear);
int32_t FX_DaysInYear(int32_t iYear);
uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth);
+
class CFX_Unitime {
public:
CFX_Unitime() { m_iUnitime = 0; }
@@ -160,6 +163,7 @@ class CFX_Unitime {
private:
FX_UNITIME m_iUnitime;
};
+
#if _FX_OS_ != _FX_ANDROID_
#pragma pack(push, 1)
#endif
@@ -399,4 +403,4 @@ class CFX_DateTime {
FX_DATETIME m_DateTime;
};
-#endif // XFA_SRC_FGAS_INCLUDE_FX_DATETIME_H_
+#endif // XFA_SRC_FGAS_LOCALIZATION_FGAS_DATETIME_H_
diff --git a/xfa/src/fgas/src/localization/fx_locale.cpp b/xfa/src/fgas/localization/fgas_locale.cpp
index a5498945ae..1eaa0ebd48 100644
--- a/xfa/src/fgas/src/localization/fx_locale.cpp
+++ b/xfa/src/fgas/localization/fgas_locale.cpp
@@ -8,7 +8,7 @@
#include "core/include/fxcrt/fx_ext.h"
#include "core/include/fxcrt/fx_xml.h"
-#include "xfa/src/fgas/src/localization/fx_localeimp.h"
+#include "xfa/src/fgas/localization/fgas_localeimp.h"
#define FX_LOCALECATEGORY_DateHash 0xbde9abde
#define FX_LOCALECATEGORY_TimeHash 0x2d71b00f
diff --git a/xfa/src/fgas/include/fx_locale.h b/xfa/src/fgas/localization/fgas_locale.h
index c558af62d0..03dd518715 100644
--- a/xfa/src/fgas/include/fx_locale.h
+++ b/xfa/src/fgas/localization/fgas_locale.h
@@ -4,11 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_LOCALE_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_LOCALE_H_
+#ifndef XFA_SRC_FGAS_LOCALIZATION_FGAS_LOCALE_H_
+#define XFA_SRC_FGAS_LOCALIZATION_FGAS_LOCALE_H_
#include "core/include/fxcrt/fx_xml.h"
-#include "xfa/src/fgas/include/fx_datetime.h"
+#include "xfa/src/fgas/localization/fgas_datetime.h"
class CFX_Unitime;
@@ -203,4 +203,4 @@ class CFX_Decimal {
uint32_t m_uMid;
};
-#endif // XFA_SRC_FGAS_INCLUDE_FX_LOCALE_H_
+#endif // XFA_SRC_FGAS_LOCALIZATION_FGAS_LOCALE_H_
diff --git a/xfa/src/fgas/src/localization/fx_localeimp.h b/xfa/src/fgas/localization/fgas_localeimp.h
index 2d4783d726..5da8b51208 100644
--- a/xfa/src/fgas/src/localization/fx_localeimp.h
+++ b/xfa/src/fgas/localization/fgas_localeimp.h
@@ -4,10 +4,10 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_SRC_LOCALIZATION_FX_LOCALEIMP_H_
-#define XFA_SRC_FGAS_SRC_LOCALIZATION_FX_LOCALEIMP_H_
+#ifndef XFA_SRC_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_
+#define XFA_SRC_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_
-#include "xfa/src/fgas/include/fx_locale.h"
+#include "xfa/src/fgas/localization/fgas_locale.h"
class CFX_LCNumeric;
@@ -119,4 +119,4 @@ class CFX_FormatString : public IFX_FormatString {
FX_BOOL m_bUseLCID;
};
-#endif // XFA_SRC_FGAS_SRC_LOCALIZATION_FX_LOCALEIMP_H_
+#endif // XFA_SRC_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_
diff --git a/xfa/src/fgas/src/localization/fx_localemgr.cpp b/xfa/src/fgas/localization/fgas_localemgr.cpp
index 49cc5068e2..81dbfd3885 100644
--- a/xfa/src/fgas/src/localization/fx_localemgr.cpp
+++ b/xfa/src/fgas/localization/fgas_localemgr.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/src/fgas/src/localization/fx_localemgr.h"
+#include "xfa/src/fgas/localization/fgas_localemgr.h"
#include "core/include/fxcrt/fx_xml.h"
diff --git a/xfa/src/fgas/src/localization/fx_localemgr.h b/xfa/src/fgas/localization/fgas_localemgr.h
index 3405b9ecab..f2693c7f60 100644
--- a/xfa/src/fgas/src/localization/fx_localemgr.h
+++ b/xfa/src/fgas/localization/fgas_localemgr.h
@@ -4,10 +4,10 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_SRC_LOCALIZATION_FX_LOCALEMGR_H_
-#define XFA_SRC_FGAS_SRC_LOCALIZATION_FX_LOCALEMGR_H_
+#ifndef XFA_SRC_FGAS_LOCALIZATION_FGAS_LOCALEMGR_H_
+#define XFA_SRC_FGAS_LOCALIZATION_FGAS_LOCALEMGR_H_
-#include "xfa/src/fgas/include/fx_locale.h"
+#include "xfa/src/fgas/localization/fgas_locale.h"
class CFX_LocaleMgr : public IFX_LocaleMgr {
public:
@@ -25,4 +25,4 @@ class CFX_LocaleMgr : public IFX_LocaleMgr {
FX_WORD m_wDefLCID;
};
-#endif // XFA_SRC_FGAS_SRC_LOCALIZATION_FX_LOCALEMGR_H_
+#endif // XFA_SRC_FGAS_LOCALIZATION_FGAS_LOCALEMGR_H_
diff --git a/xfa/src/fgas/src/crt/fx_memory.h b/xfa/src/fgas/src/crt/fx_memory.h
deleted file mode 100644
index d933945cb6..0000000000
--- a/xfa/src/fgas/src/crt/fx_memory.h
+++ /dev/null
@@ -1,140 +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 XFA_SRC_FGAS_SRC_CRT_FX_MEMORY_H_
-#define XFA_SRC_FGAS_SRC_CRT_FX_MEMORY_H_
-
-#include "xfa/src/fgas/include/fx_mem.h"
-
-class CFX_DefStore;
-class CFX_StaticStore;
-class CFX_FixedStore;
-class CFX_DynamicStore;
-class CFX_DefStore : public IFX_MEMAllocator, public CFX_Target {
- public:
- CFX_DefStore() {}
- ~CFX_DefStore() {}
- virtual void Release() { delete this; }
- virtual void* Alloc(size_t size) { return FX_Alloc(uint8_t, size); }
- virtual void Free(void* pBlock) { FX_Free(pBlock); }
- virtual size_t GetBlockSize() const { return 0; }
- virtual size_t GetDefChunkSize() const { return 0; }
- virtual size_t SetDefChunkSize(size_t size) { return 0; }
- virtual size_t GetCurrentDataSize() const { return 0; }
-};
-
-#if _FX_OS_ != _FX_ANDROID_
-#pragma pack(push, 1)
-#endif
-struct FX_STATICSTORECHUNK {
- FX_STATICSTORECHUNK* pNextChunk;
- size_t iChunkSize;
- size_t iFreeSize;
-};
-#if _FX_OS_ != _FX_ANDROID_
-#pragma pack(pop)
-#endif
-
-class CFX_StaticStore : public IFX_MEMAllocator, public CFX_Target {
- public:
- CFX_StaticStore(size_t iDefChunkSize = 4096);
- ~CFX_StaticStore();
- virtual void Release() { delete this; }
- virtual void* Alloc(size_t size);
- virtual void Free(void* pBlock) {}
- virtual size_t GetBlockSize() const { return 0; }
- virtual size_t GetDefChunkSize() const { return m_iDefChunkSize; }
- virtual size_t SetDefChunkSize(size_t size);
- virtual size_t GetCurrentDataSize() const { return m_iAllocatedSize; }
-
- protected:
- size_t m_iAllocatedSize;
- size_t m_iDefChunkSize;
- FX_STATICSTORECHUNK* m_pChunk;
- FX_STATICSTORECHUNK* m_pLastChunk;
- FX_STATICSTORECHUNK* AllocChunk(size_t size);
- FX_STATICSTORECHUNK* FindChunk(size_t size);
-};
-
-#if _FX_OS_ != _FX_ANDROID_
-#pragma pack(push, 1)
-#endif
-struct FX_FIXEDSTORECHUNK {
- uint8_t* FirstFlag() { return reinterpret_cast<uint8_t*>(this + 1); }
- uint8_t* FirstBlock() { return FirstFlag() + iChunkSize; }
-
- FX_FIXEDSTORECHUNK* pNextChunk;
- size_t iChunkSize;
- size_t iFreeNum;
-};
-#if _FX_OS_ != _FX_ANDROID_
-#pragma pack(pop)
-#endif
-
-class CFX_FixedStore : public IFX_MEMAllocator, public CFX_Target {
- public:
- CFX_FixedStore(size_t iBlockSize, size_t iBlockNumsInChunk);
- virtual ~CFX_FixedStore();
- virtual void Release() { delete this; }
- virtual void* Alloc(size_t size);
- virtual void Free(void* pBlock);
- virtual size_t GetBlockSize() const { return m_iBlockSize; }
- virtual size_t GetDefChunkSize() const { return m_iDefChunkSize; }
- virtual size_t SetDefChunkSize(size_t iChunkSize);
- virtual size_t GetCurrentDataSize() const { return 0; }
-
- protected:
- FX_FIXEDSTORECHUNK* AllocChunk();
-
- size_t m_iBlockSize;
- size_t m_iDefChunkSize;
- FX_FIXEDSTORECHUNK* m_pChunk;
-};
-
-#if _FX_OS_ != _FX_ANDROID_
-#pragma pack(push, 1)
-#endif
-struct FX_DYNAMICSTOREBLOCK {
- uint8_t* Data() { return reinterpret_cast<uint8_t*>(this + 1); }
- FX_DYNAMICSTOREBLOCK* NextBlock() {
- return reinterpret_cast<FX_DYNAMICSTOREBLOCK*>(Data() + iBlockSize);
- }
- size_t iBlockSize;
- FX_BOOL bUsed;
-};
-
-struct FX_DYNAMICSTORECHUNK {
- FX_DYNAMICSTOREBLOCK* FirstBlock() {
- return reinterpret_cast<FX_DYNAMICSTOREBLOCK*>(this + 1);
- }
- FX_DYNAMICSTORECHUNK* pNextChunk;
- size_t iChunkSize;
- size_t iFreeSize;
-};
-#if _FX_OS_ != _FX_ANDROID_
-#pragma pack(pop)
-#endif
-
-class CFX_DynamicStore : public IFX_MEMAllocator, public CFX_Target {
- public:
- CFX_DynamicStore(size_t iDefChunkSize = 4096);
- virtual ~CFX_DynamicStore();
- virtual void Release() { delete this; }
- virtual void* Alloc(size_t size);
- virtual void Free(void* pBlock);
- virtual size_t GetBlockSize() const { return 0; }
- virtual size_t GetDefChunkSize() const { return m_iDefChunkSize; }
- virtual size_t SetDefChunkSize(size_t size);
- virtual size_t GetCurrentDataSize() const { return 0; }
-
- protected:
- FX_DYNAMICSTORECHUNK* AllocChunk(size_t size);
-
- size_t m_iDefChunkSize;
- FX_DYNAMICSTORECHUNK* m_pChunk;
-};
-
-#endif // XFA_SRC_FGAS_SRC_CRT_FX_MEMORY_H_
diff --git a/xfa/src/fgas/src/crt/fx_stream.h b/xfa/src/fgas/src/crt/fx_stream.h
deleted file mode 100644
index 6fd8ff9af8..0000000000
--- a/xfa/src/fgas/src/crt/fx_stream.h
+++ /dev/null
@@ -1,310 +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 XFA_SRC_FGAS_SRC_CRT_FX_STREAM_H_
-#define XFA_SRC_FGAS_SRC_CRT_FX_STREAM_H_
-
-#include "core/include/fxcrt/fx_system.h"
-#include "xfa/src/fgas/include/fx_stm.h"
-
-class CFX_FileStreamImp;
-class CFX_BufferStreamImp;
-class CFX_FileReadStreamImp;
-class CFX_BufferReadStreamImp;
-class CFX_FileWriteStreamImp;
-class CFX_Stream;
-class CFX_TextStream;
-class CFX_FileRead;
-class CFX_FileWrite;
-class CFX_BufferAccImp;
-
-class CFX_StreamImp {
- public:
- virtual void Release() { delete this; }
- virtual FX_DWORD GetAccessModes() const { return m_dwAccess; }
- virtual int32_t GetLength() const = 0;
- virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0;
- virtual int32_t GetPosition() = 0;
- virtual FX_BOOL IsEOF() const = 0;
- virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) = 0;
- virtual int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS) = 0;
- virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) = 0;
- virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) = 0;
- virtual void Flush() = 0;
- virtual FX_BOOL SetLength(int32_t iLength) = 0;
-
- protected:
- CFX_StreamImp();
- virtual ~CFX_StreamImp() {}
- FX_DWORD m_dwAccess;
-};
-class CFX_FileStreamImp : public CFX_StreamImp {
- public:
- CFX_FileStreamImp();
- virtual ~CFX_FileStreamImp();
- FX_BOOL LoadFile(const FX_WCHAR* pszSrcFileName, FX_DWORD dwAccess);
- virtual int32_t GetLength() const;
- virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
- virtual int32_t GetPosition();
- virtual FX_BOOL IsEOF() const;
- virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize);
- virtual int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS);
- virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize);
- virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength);
- virtual void Flush();
- virtual FX_BOOL SetLength(int32_t iLength);
-
- protected:
- FXSYS_FILE* m_hFile;
- int32_t m_iLength;
-};
-class CFX_BufferStreamImp : public CFX_StreamImp {
- public:
- CFX_BufferStreamImp();
- virtual ~CFX_BufferStreamImp() {}
- FX_BOOL LoadBuffer(uint8_t* pData, int32_t iTotalSize, FX_DWORD dwAccess);
- virtual int32_t GetLength() const;
- virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
- virtual int32_t GetPosition();
- virtual FX_BOOL IsEOF() const;
- virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize);
- virtual int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS);
- virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize);
- virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength);
- virtual void Flush() {}
- virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; }
-
- protected:
- uint8_t* m_pData;
- int32_t m_iTotalSize;
- int32_t m_iPosition;
- int32_t m_iLength;
-};
-class CFX_FileReadStreamImp : public CFX_StreamImp {
- public:
- CFX_FileReadStreamImp();
- virtual ~CFX_FileReadStreamImp() {}
- FX_BOOL LoadFileRead(IFX_FileRead* pFileRead, FX_DWORD dwAccess);
- virtual int32_t GetLength() const;
- virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
- virtual int32_t GetPosition() { return m_iPosition; }
- virtual FX_BOOL IsEOF() const;
-
- virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize);
- virtual int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS);
- virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) {
- return 0;
- }
- virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) {
- return 0;
- }
- virtual void Flush() {}
- virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; }
-
- protected:
- IFX_FileRead* m_pFileRead;
- int32_t m_iPosition;
- int32_t m_iLength;
-};
-class CFX_BufferReadStreamImp : public CFX_StreamImp {
- public:
- CFX_BufferReadStreamImp();
- ~CFX_BufferReadStreamImp();
- FX_BOOL LoadBufferRead(IFX_BufferRead* pBufferRead,
- int32_t iFileSize,
- FX_DWORD dwAccess,
- FX_BOOL bReleaseBufferRead);
-
- virtual int32_t GetLength() const;
- virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
- virtual int32_t GetPosition() { return m_iPosition; }
- virtual FX_BOOL IsEOF() const;
-
- virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize);
- virtual int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS);
- virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) {
- return 0;
- }
- virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) {
- return 0;
- }
- virtual void Flush() {}
- virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; }
-
- private:
- IFX_BufferRead* m_pBufferRead;
- FX_BOOL m_bReleaseBufferRead;
- int32_t m_iPosition;
- int32_t m_iBufferSize;
-};
-class CFX_FileWriteStreamImp : public CFX_StreamImp {
- public:
- CFX_FileWriteStreamImp();
- virtual ~CFX_FileWriteStreamImp() {}
- FX_BOOL LoadFileWrite(IFX_FileWrite* pFileWrite, FX_DWORD dwAccess);
- virtual int32_t GetLength() const;
- virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
- virtual int32_t GetPosition() { return m_iPosition; }
- virtual FX_BOOL IsEOF() const;
- virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) { return 0; }
- virtual int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS) {
- return 0;
- }
- virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize);
- virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength);
- virtual void Flush();
- virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; }
-
- protected:
- IFX_FileWrite* m_pFileWrite;
- int32_t m_iPosition;
-};
-enum FX_STREAMTYPE {
- FX_SREAMTYPE_Unknown = 0,
- FX_STREAMTYPE_File,
- FX_STREAMTYPE_Buffer,
- FX_STREAMTYPE_Stream,
- FX_STREAMTYPE_BufferRead,
-};
-class CFX_Stream : public IFX_Stream {
- public:
- CFX_Stream();
- ~CFX_Stream();
- FX_BOOL LoadFile(const FX_WCHAR* pszSrcFileName, FX_DWORD dwAccess);
- FX_BOOL LoadBuffer(uint8_t* pData, int32_t iTotalSize, FX_DWORD dwAccess);
- FX_BOOL LoadFileRead(IFX_FileRead* pFileRead, FX_DWORD dwAccess);
- FX_BOOL LoadFileWrite(IFX_FileWrite* pFileWrite, FX_DWORD dwAccess);
- FX_BOOL LoadBufferRead(IFX_BufferRead* pBufferRead,
- int32_t iFileSize,
- FX_DWORD dwAccess,
- FX_BOOL bReleaseBufferRead);
- virtual void Release();
- virtual IFX_Stream* Retain();
- virtual FX_DWORD GetAccessModes() const { return m_dwAccess; }
- virtual int32_t GetLength() const;
- virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
- virtual int32_t GetPosition();
- virtual FX_BOOL IsEOF() const;
- virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize);
- virtual int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS,
- int32_t const* pByteSize = NULL);
- virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize);
- virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength);
- virtual void Flush();
- virtual FX_BOOL SetLength(int32_t iLength);
- virtual int32_t GetBOM(uint8_t bom[4]) const;
- virtual FX_WORD GetCodePage() const;
- virtual FX_WORD SetCodePage(FX_WORD wCodePage);
- virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess,
- int32_t iOffset,
- int32_t iLength);
-
- protected:
- FX_STREAMTYPE m_eStreamType;
- CFX_StreamImp* m_pStreamImp;
- FX_DWORD m_dwAccess;
- int32_t m_iTotalSize;
- int32_t m_iPosition;
- int32_t m_iStart;
- int32_t m_iLength;
- int32_t m_iRefCount;
-};
-class CFX_TextStream : public IFX_Stream {
- public:
- CFX_TextStream(IFX_Stream* pStream, FX_BOOL bDelStream);
- ~CFX_TextStream();
- virtual void Release();
- virtual IFX_Stream* Retain();
-
- virtual FX_DWORD GetAccessModes() const;
- virtual int32_t GetLength() const;
- virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
- virtual int32_t GetPosition();
- virtual FX_BOOL IsEOF() const;
-
- virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize);
- virtual int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS,
- int32_t const* pByteSize = NULL);
- virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize);
- virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength);
- virtual void Flush();
- virtual FX_BOOL SetLength(int32_t iLength);
-
- virtual int32_t GetBOM(uint8_t bom[4]) const;
- virtual FX_WORD GetCodePage() const;
- virtual FX_WORD SetCodePage(FX_WORD wCodePage);
-
- virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess,
- int32_t iOffset,
- int32_t iLength);
-
- protected:
- FX_WORD m_wCodePage;
- int32_t m_wBOMLength;
- FX_DWORD m_dwBOM;
- uint8_t* m_pBuf;
- int32_t m_iBufSize;
- FX_BOOL m_bDelStream;
- IFX_Stream* m_pStreamImp;
- int32_t m_iRefCount;
- void InitStream();
-};
-
-class CFGAS_FileRead : public IFX_FileRead {
- public:
- CFGAS_FileRead(IFX_Stream* pStream, FX_BOOL bReleaseStream);
- virtual ~CFGAS_FileRead();
- virtual void Release() { delete this; }
- virtual FX_FILESIZE GetSize();
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);
-
- protected:
- FX_BOOL m_bReleaseStream;
- IFX_Stream* m_pStream;
-};
-
-class CFX_BufferAccImp : public IFX_FileRead {
- public:
- CFX_BufferAccImp(IFX_BufferRead* pBufferRead,
- FX_FILESIZE iFileSize,
- FX_BOOL bReleaseStream);
- virtual ~CFX_BufferAccImp();
- virtual void Release() { delete this; }
- virtual FX_FILESIZE GetSize();
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);
-
- protected:
- IFX_BufferRead* m_pBufferRead;
- FX_BOOL m_bReleaseStream;
- FX_FILESIZE m_iBufSize;
-};
-
-class CFGAS_FileWrite : public IFX_FileWrite {
- public:
- CFGAS_FileWrite(IFX_Stream* pStream, FX_BOOL bReleaseStream);
- virtual ~CFGAS_FileWrite();
- virtual void Release() { delete this; }
- virtual FX_FILESIZE GetSize();
- virtual FX_BOOL Flush();
- virtual FX_BOOL WriteBlock(const void* pData, size_t size);
- virtual FX_BOOL WriteBlock(const void* pData,
- FX_FILESIZE offset,
- size_t size);
-
- protected:
- IFX_Stream* m_pStream;
- FX_BOOL m_bReleaseStream;
-};
-
-#endif // XFA_SRC_FGAS_SRC_CRT_FX_STREAM_H_
diff --git a/xfa/src/fgas/src/crt/fx_utils.h b/xfa/src/fgas/src/crt/fx_utils.h
deleted file mode 100644
index 3683e5a821..0000000000
--- a/xfa/src/fgas/src/crt/fx_utils.h
+++ /dev/null
@@ -1,41 +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 XFA_SRC_FGAS_SRC_CRT_FX_UTILS_H_
-#define XFA_SRC_FGAS_SRC_CRT_FX_UTILS_H_
-
-#include "core/include/fxcrt/fx_basic.h"
-#include "xfa/src/fgas/include/fx_mem.h"
-
-class CFX_BaseMassArrayImp : public CFX_Target {
- public:
- CFX_BaseMassArrayImp(int32_t iChunkSize, int32_t iBlockSize);
- ~CFX_BaseMassArrayImp();
- uint8_t* AddSpace() { return AddSpaceTo(m_iBlockCount); }
- uint8_t* AddSpaceTo(int32_t index);
- uint8_t* GetAt(int32_t index) const;
- int32_t Append(const CFX_BaseMassArrayImp& src,
- int32_t iStart = 0,
- int32_t iCount = -1);
- int32_t Copy(const CFX_BaseMassArrayImp& src,
- int32_t iStart = 0,
- int32_t iCount = -1);
- int32_t RemoveLast(int32_t iCount = -1);
- void RemoveAll(FX_BOOL bLeaveMemory = FALSE);
- int32_t m_iChunkSize;
- int32_t m_iBlockSize;
- int32_t m_iChunkCount;
- int32_t m_iBlockCount;
- CFX_PtrArray* m_pData;
-
- protected:
- void Append(int32_t iDstStart,
- const CFX_BaseMassArrayImp& src,
- int32_t iSrcStart = 0,
- int32_t iSrcCount = -1);
-};
-
-#endif // XFA_SRC_FGAS_SRC_CRT_FX_UTILS_H_
diff --git a/xfa/src/fgas/src/layout/fx_rtfbreak.h b/xfa/src/fgas/src/layout/fx_rtfbreak.h
deleted file mode 100644
index 7aecef7f10..0000000000
--- a/xfa/src/fgas/src/layout/fx_rtfbreak.h
+++ /dev/null
@@ -1,177 +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 XFA_SRC_FGAS_SRC_LAYOUT_FX_RTFBREAK_H_
-#define XFA_SRC_FGAS_SRC_LAYOUT_FX_RTFBREAK_H_
-
-#include "core/include/fxcrt/fx_arb.h"
-#include "xfa/src/fgas/include/fx_rbk.h"
-#include "xfa/src/fgas/src/layout/fx_unicode.h"
-
-class CFX_RTFLine;
-class CFX_RTFBreak;
-class CFX_RTFLine {
- public:
- CFX_RTFLine()
- : m_LinePieces(16),
- m_iStart(0),
- m_iWidth(0),
- m_iArabicChars(0),
- m_iMBCSChars(0) {}
- ~CFX_RTFLine() { RemoveAll(); }
- int32_t CountChars() const { return m_LineChars.GetSize(); }
- CFX_RTFChar& GetChar(int32_t index) {
- FXSYS_assert(index > -1 && index < m_LineChars.GetSize());
- return *m_LineChars.GetDataPtr(index);
- }
- CFX_RTFChar* GetCharPtr(int32_t index) {
- FXSYS_assert(index > -1 && index < m_LineChars.GetSize());
- return m_LineChars.GetDataPtr(index);
- }
- int32_t CountPieces() const { return m_LinePieces.GetSize(); }
- CFX_RTFPiece& GetPiece(int32_t index) const {
- FXSYS_assert(index > -1 && index < m_LinePieces.GetSize());
- return m_LinePieces.GetAt(index);
- }
- CFX_RTFPiece* GetPiecePtr(int32_t index) const {
- FXSYS_assert(index > -1 && index < m_LinePieces.GetSize());
- return m_LinePieces.GetPtrAt(index);
- }
- int32_t GetLineEnd() const { return m_iStart + m_iWidth; }
- void RemoveAll(FX_BOOL bLeaveMemory = FALSE) {
- CFX_RTFChar* pChar;
- IFX_Unknown* pUnknown;
- int32_t iCount = m_LineChars.GetSize();
- for (int32_t i = 0; i < iCount; i++) {
- pChar = m_LineChars.GetDataPtr(i);
- if ((pUnknown = pChar->m_pUserData) != NULL) {
- pUnknown->Release();
- }
- }
- m_LineChars.RemoveAll();
- m_LinePieces.RemoveAll(bLeaveMemory);
- m_iWidth = 0;
- m_iArabicChars = 0;
- m_iMBCSChars = 0;
- }
- CFX_RTFCharArray m_LineChars;
- CFX_RTFPieceArray m_LinePieces;
- int32_t m_iStart;
- int32_t m_iWidth;
- int32_t m_iArabicChars;
- int32_t m_iMBCSChars;
-};
-class CFX_RTFBreak : public IFX_RTFBreak {
- public:
- CFX_RTFBreak(FX_DWORD dwPolicies);
- ~CFX_RTFBreak();
- void Release() override { delete this; }
- void SetLineBoundary(FX_FLOAT fLineStart, FX_FLOAT fLineEnd) override;
- void SetLineStartPos(FX_FLOAT fLinePos) override;
- FX_DWORD GetLayoutStyles() const override { return m_dwLayoutStyles; }
- void SetLayoutStyles(FX_DWORD dwLayoutStyles) override;
- void SetFont(IFX_Font* pFont) override;
- void SetFontSize(FX_FLOAT fFontSize) override;
- void SetTabWidth(FX_FLOAT fTabWidth) override;
- void AddPositionedTab(FX_FLOAT fTabPos) override;
- void SetPositionedTabs(const CFX_FloatArray& tabs) override;
- void ClearPositionedTabs() override;
- void SetDefaultChar(FX_WCHAR wch) override;
- void SetLineBreakChar(FX_WCHAR wch) override;
- void SetLineBreakTolerance(FX_FLOAT fTolerance) override;
- void SetHorizontalScale(int32_t iScale) override;
- void SetVerticalScale(int32_t iScale) override;
- void SetCharRotation(int32_t iCharRotation) override;
- void SetCharSpace(FX_FLOAT fCharSpace) override;
- void SetWordSpace(FX_BOOL bDefault, FX_FLOAT fWordSpace) override;
- void SetReadingOrder(FX_BOOL bRTL = FALSE) override;
- void SetAlignment(int32_t iAlignment = FX_RTFLINEALIGNMENT_Left) override;
- void SetUserData(IFX_Unknown* pUserData) override;
- FX_DWORD AppendChar(FX_WCHAR wch) override;
- FX_DWORD EndBreak(FX_DWORD dwStatus = FX_RTFBREAK_PieceBreak) override;
- int32_t CountBreakPieces() const override;
- const CFX_RTFPiece* GetBreakPiece(int32_t index) const override;
- void GetLineRect(CFX_RectF& rect) const override;
- void ClearBreakPieces() override;
- void Reset() override;
- int32_t GetDisplayPos(
- const FX_RTFTEXTOBJ* pText,
- FXTEXT_CHARPOS* pCharPos,
- FX_BOOL bCharCode = FALSE,
- CFX_WideString* pWSForms = NULL,
- FX_AdjustCharDisplayPos pAdjustPos = NULL) const override;
- int32_t GetCharRects(const FX_RTFTEXTOBJ* pText,
- CFX_RectFArray& rtArray,
- FX_BOOL bCharBBox = FALSE) const override;
- FX_DWORD AppendChar_CharCode(FX_WCHAR wch);
- FX_DWORD AppendChar_Combination(CFX_RTFChar* pCurChar, int32_t iRotation);
- FX_DWORD AppendChar_Tab(CFX_RTFChar* pCurChar, int32_t iRotation);
- FX_DWORD AppendChar_Control(CFX_RTFChar* pCurChar, int32_t iRotation);
- FX_DWORD AppendChar_Arabic(CFX_RTFChar* pCurChar, int32_t iRotation);
- FX_DWORD AppendChar_Others(CFX_RTFChar* pCurChar, int32_t iRotation);
-
- protected:
- FX_DWORD m_dwPolicies;
- IFX_ArabicChar* m_pArabicChar;
- int32_t m_iBoundaryStart;
- int32_t m_iBoundaryEnd;
- FX_DWORD m_dwLayoutStyles;
- FX_BOOL m_bPagination;
- FX_BOOL m_bVertical;
- FX_BOOL m_bSingleLine;
- FX_BOOL m_bCharCode;
- IFX_Font* m_pFont;
- int32_t m_iFontHeight;
- int32_t m_iFontSize;
- int32_t m_iTabWidth;
- CFX_Int32Array m_PositionedTabs;
- FX_BOOL m_bOrphanLine;
- FX_WCHAR m_wDefChar;
- int32_t m_iDefChar;
- FX_WCHAR m_wLineBreakChar;
- int32_t m_iHorizontalScale;
- int32_t m_iVerticalScale;
- int32_t m_iLineRotation;
- int32_t m_iCharRotation;
- int32_t m_iRotation;
- int32_t m_iCharSpace;
- FX_BOOL m_bWordSpace;
- int32_t m_iWordSpace;
- FX_BOOL m_bRTL;
- int32_t m_iAlignment;
- IFX_Unknown* m_pUserData;
- FX_DWORD m_dwCharType;
- FX_DWORD m_dwIdentity;
- CFX_RTFLine m_RTFLine1;
- CFX_RTFLine m_RTFLine2;
- CFX_RTFLine* m_pCurLine;
- int32_t m_iReady;
- int32_t m_iTolerance;
- int32_t GetLineRotation(FX_DWORD dwStyles) const;
- void SetBreakStatus();
- CFX_RTFChar* GetLastChar(int32_t index) const;
- CFX_RTFLine* GetRTFLine(FX_BOOL bReady) const;
- CFX_RTFPieceArray* GetRTFPieces(FX_BOOL bReady) const;
- FX_DWORD GetUnifiedCharType(FX_DWORD dwType) const;
- int32_t GetLastPositionedTab() const;
- FX_BOOL GetPositionedTab(int32_t& iTabPos) const;
- int32_t GetBreakPos(CFX_RTFCharArray& tca,
- int32_t& iEndPos,
- FX_BOOL bAllChars = FALSE,
- FX_BOOL bOnlyBrk = FALSE);
- void SplitTextLine(CFX_RTFLine* pCurLine,
- CFX_RTFLine* pNextLine,
- FX_BOOL bAllChars = FALSE);
- FX_BOOL EndBreak_SplitLine(CFX_RTFLine* pNextLine,
- FX_BOOL bAllChars,
- FX_DWORD dwStatus);
- void EndBreak_BidiLine(CFX_TPOArray& tpos, FX_DWORD dwStatus);
- void EndBreak_Alignment(CFX_TPOArray& tpos,
- FX_BOOL bAllChars,
- FX_DWORD dwStatus);
-};
-
-#endif // XFA_SRC_FGAS_SRC_LAYOUT_FX_RTFBREAK_H_
diff --git a/xfa/src/fgas/src/layout/fx_textbreak.h b/xfa/src/fgas/src/layout/fx_textbreak.h
deleted file mode 100644
index fa15afd76a..0000000000
--- a/xfa/src/fgas/src/layout/fx_textbreak.h
+++ /dev/null
@@ -1,174 +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 XFA_SRC_FGAS_SRC_LAYOUT_FX_TEXTBREAK_H_
-#define XFA_SRC_FGAS_SRC_LAYOUT_FX_TEXTBREAK_H_
-
-#include "core/include/fxcrt/fx_ucd.h"
-#include "core/include/fxcrt/fx_memory.h"
-#include "xfa/src/fgas/include/fx_tbk.h"
-#include "xfa/src/fgas/src/layout/fx_unicode.h"
-
-class IFX_ArabicChar;
-
-class CFX_TxtLine {
- public:
- CFX_TxtLine(int32_t iBlockSize)
- : m_iStart(0), m_iWidth(0), m_iArabicChars(0) {
- m_pLineChars = new CFX_TxtCharArray;
- m_pLinePieces = new CFX_TxtPieceArray(16);
- }
- ~CFX_TxtLine() {
- RemoveAll();
- delete m_pLineChars;
- delete m_pLinePieces;
- }
- int32_t CountChars() const { return m_pLineChars->GetSize(); }
- CFX_TxtChar* GetCharPtr(int32_t index) const {
- FXSYS_assert(index > -1 && index < m_pLineChars->GetSize());
- return m_pLineChars->GetDataPtr(index);
- }
- int32_t CountPieces() const { return m_pLinePieces->GetSize(); }
- CFX_TxtPiece* GetPiecePtr(int32_t index) const {
- FXSYS_assert(index > -1 && index < m_pLinePieces->GetSize());
- return m_pLinePieces->GetPtrAt(index);
- }
- void GetString(CFX_WideString& wsStr) const {
- int32_t iCount = m_pLineChars->GetSize();
- FX_WCHAR* pBuf = wsStr.GetBuffer(iCount);
- CFX_Char* pChar;
- for (int32_t i = 0; i < iCount; i++) {
- pChar = m_pLineChars->GetDataPtr(i);
- *pBuf++ = (FX_WCHAR)pChar->m_wCharCode;
- }
- wsStr.ReleaseBuffer(iCount);
- }
- void RemoveAll(FX_BOOL bLeaveMemory = FALSE) {
- m_pLineChars->RemoveAll();
- m_pLinePieces->RemoveAll(bLeaveMemory);
- m_iWidth = 0;
- m_iArabicChars = 0;
- }
- CFX_TxtCharArray* m_pLineChars;
- CFX_TxtPieceArray* m_pLinePieces;
- int32_t m_iStart;
- int32_t m_iWidth;
- int32_t m_iArabicChars;
-};
-class CFX_TxtBreak : public IFX_TxtBreak {
- public:
- CFX_TxtBreak(FX_DWORD dwPolicies);
- ~CFX_TxtBreak();
- virtual void Release() { delete this; }
- virtual void SetLineWidth(FX_FLOAT fLineWidth);
- virtual void SetLinePos(FX_FLOAT fLinePos);
- virtual FX_DWORD GetLayoutStyles() const { return m_dwLayoutStyles; }
- virtual void SetLayoutStyles(FX_DWORD dwLayoutStyles);
- virtual void SetFont(IFX_Font* pFont);
- virtual void SetFontSize(FX_FLOAT fFontSize);
- virtual void SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant);
- virtual void SetDefaultChar(FX_WCHAR wch);
- virtual void SetParagraphBreakChar(FX_WCHAR wch);
- virtual void SetLineBreakTolerance(FX_FLOAT fTolerance);
- virtual void SetHorizontalScale(int32_t iScale);
- virtual void SetVerticalScale(int32_t iScale);
- virtual void SetCharRotation(int32_t iCharRotation);
- virtual void SetCharSpace(FX_FLOAT fCharSpace);
- virtual void SetAlignment(int32_t iAlignment);
- virtual FX_DWORD GetContextCharStyles() const;
- virtual void SetContextCharStyles(FX_DWORD dwCharStyles);
- virtual void SetCombWidth(FX_FLOAT fCombWidth);
- virtual void SetUserData(void* pUserData);
- virtual FX_DWORD AppendChar(FX_WCHAR wch);
- virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_TXTBREAK_PieceBreak);
- virtual int32_t CountBreakChars() const;
- virtual int32_t CountBreakPieces() const;
- virtual const CFX_TxtPiece* GetBreakPiece(int32_t index) const;
- virtual void ClearBreakPieces();
- virtual void Reset();
- virtual int32_t GetDisplayPos(
- const FX_TXTRUN* pTxtRun,
- FXTEXT_CHARPOS* pCharPos,
- FX_BOOL bCharCode = FALSE,
- CFX_WideString* pWSForms = NULL,
- FX_AdjustCharDisplayPos pAdjustPos = NULL) const;
- virtual int32_t GetCharRects(const FX_TXTRUN* pTxtRun,
- CFX_RectFArray& rtArray,
- FX_BOOL bCharBBox = FALSE) const;
- void AppendChar_PageLoad(CFX_Char* pCurChar, FX_DWORD dwProps);
- FX_DWORD AppendChar_Combination(CFX_Char* pCurChar, int32_t iRotation);
- FX_DWORD AppendChar_Tab(CFX_Char* pCurChar, int32_t iRotation);
- FX_DWORD AppendChar_Control(CFX_Char* pCurChar, int32_t iRotation);
- FX_DWORD AppendChar_Arabic(CFX_Char* pCurChar, int32_t iRotation);
- FX_DWORD AppendChar_Others(CFX_Char* pCurChar, int32_t iRotation);
-
- protected:
- FX_DWORD m_dwPolicies;
- FX_BOOL m_bPagination;
- IFX_ArabicChar* m_pArabicChar;
- int32_t m_iLineWidth;
- FX_DWORD m_dwLayoutStyles;
- FX_BOOL m_bVertical;
- FX_BOOL m_bArabicContext;
- FX_BOOL m_bArabicShapes;
- FX_BOOL m_bRTL;
- FX_BOOL m_bSingleLine;
- FX_BOOL m_bCombText;
- int32_t m_iArabicContext;
- int32_t m_iCurArabicContext;
- IFX_Font* m_pFont;
- int32_t m_iFontSize;
- FX_BOOL m_bEquidistant;
- int32_t m_iTabWidth;
- FX_WCHAR m_wDefChar;
- FX_WCHAR m_wParagBreakChar;
- int32_t m_iDefChar;
- int32_t m_iLineRotation;
- int32_t m_iCharRotation;
- int32_t m_iRotation;
- int32_t m_iAlignment;
- FX_DWORD m_dwContextCharStyles;
- int32_t m_iCombWidth;
- void* m_pUserData;
- FX_DWORD m_dwCharType;
- FX_BOOL m_bCurRTL;
- int32_t m_iCurAlignment;
- FX_BOOL m_bArabicNumber;
- FX_BOOL m_bArabicComma;
- CFX_TxtLine* m_pTxtLine1;
- CFX_TxtLine* m_pTxtLine2;
- CFX_TxtLine* m_pCurLine;
- int32_t m_iReady;
- int32_t m_iTolerance;
- int32_t m_iHorScale;
- int32_t m_iVerScale;
- int32_t m_iCharSpace;
- void SetBreakStatus();
- int32_t GetLineRotation(FX_DWORD dwStyles) const;
- CFX_TxtChar* GetLastChar(int32_t index, FX_BOOL bOmitChar = TRUE) const;
- CFX_TxtLine* GetTxtLine(FX_BOOL bReady) const;
- CFX_TxtPieceArray* GetTxtPieces(FX_BOOL bReady) const;
- FX_DWORD GetUnifiedCharType(FX_DWORD dwType) const;
- void ResetArabicContext();
- void ResetContextCharStyles();
- void EndBreak_UpdateArabicShapes();
- FX_BOOL EndBreak_SplitLine(CFX_TxtLine* pNextLine,
- FX_BOOL bAllChars,
- FX_DWORD dwStatus);
- void EndBreak_BidiLine(CFX_TPOArray& tpos, FX_DWORD dwStatus);
- void EndBreak_Alignment(CFX_TPOArray& tpos,
- FX_BOOL bAllChars,
- FX_DWORD dwStatus);
- int32_t GetBreakPos(CFX_TxtCharArray& ca,
- int32_t& iEndPos,
- FX_BOOL bAllChars = FALSE,
- FX_BOOL bOnlyBrk = FALSE);
- void SplitTextLine(CFX_TxtLine* pCurLine,
- CFX_TxtLine* pNextLine,
- FX_BOOL bAllChars = FALSE);
-};
-
-#endif // XFA_SRC_FGAS_SRC_LAYOUT_FX_TEXTBREAK_H_
diff --git a/xfa/src/fgas/src/layout/fx_unicode.h b/xfa/src/fgas/src/layout/fx_unicode.h
deleted file mode 100644
index 0b119dec1c..0000000000
--- a/xfa/src/fgas/src/layout/fx_unicode.h
+++ /dev/null
@@ -1,20 +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 XFA_SRC_FGAS_SRC_LAYOUT_FX_UNICODE_H_
-#define XFA_SRC_FGAS_SRC_LAYOUT_FX_UNICODE_H_
-
-#include "xfa/src/fgas/include/fx_utl.h"
-
-struct FX_TPO {
- int32_t index;
- int32_t pos;
-};
-typedef CFX_MassArrayTemplate<FX_TPO> CFX_TPOArray;
-
-void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray& tpos, int32_t iStart, int32_t iEnd);
-
-#endif // XFA_SRC_FGAS_SRC_LAYOUT_FX_UNICODE_H_
diff --git a/xfa/src/fgas/include/fx_sax.h b/xfa/src/fgas/xml/fgas_sax.h
index e4b72f6328..50762d4401 100644
--- a/xfa/src/fgas/include/fx_sax.h
+++ b/xfa/src/fgas/xml/fgas_sax.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_INCLUDE_FX_SAX_H_
-#define XFA_SRC_FGAS_INCLUDE_FX_SAX_H_
+#ifndef XFA_SRC_FGAS_XML_FGAS_SAX_H_
+#define XFA_SRC_FGAS_XML_FGAS_SAX_H_
#include "core/include/fxcrt/fx_basic.h"
@@ -65,4 +65,4 @@ class IFX_SAXReader {
};
IFX_SAXReader* FX_SAXReader_Create();
-#endif // XFA_SRC_FGAS_INCLUDE_FX_SAX_H_
+#endif // XFA_SRC_FGAS_XML_FGAS_SAX_H_
diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.cpp b/xfa/src/fgas/xml/fgas_sax_imp.cpp
index 251af01a06..f30a357497 100644
--- a/xfa/src/fgas/src/xml/fx_sax_imp.cpp
+++ b/xfa/src/fgas/xml/fgas_sax_imp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/src/fgas/src/xml/fx_sax_imp.h"
+#include "xfa/src/fgas/xml/fgas_sax_imp.h"
#include <algorithm>
diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.h b/xfa/src/fgas/xml/fgas_sax_imp.h
index 13e5036ec3..a65f2abaa9 100644
--- a/xfa/src/fgas/src/xml/fx_sax_imp.h
+++ b/xfa/src/fgas/xml/fgas_sax_imp.h
@@ -4,10 +4,10 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_SRC_FGAS_SRC_XML_FX_SAX_IMP_H_
-#define XFA_SRC_FGAS_SRC_XML_FX_SAX_IMP_H_
+#ifndef XFA_SRC_FGAS_XML_FGAS_SAX_IMP_H_
+#define XFA_SRC_FGAS_XML_FGAS_SAX_IMP_H_
-#include "xfa/src/fgas/include/fx_sax.h"
+#include "xfa/src/fgas/xml/fgas_sax.h"
class CFX_SAXFile {
public:
@@ -138,4 +138,4 @@ class CFX_SAXReader : public IFX_SAXReader {
void ParseChar(uint8_t ch);
};
-#endif // XFA_SRC_FGAS_SRC_XML_FX_SAX_IMP_H_
+#endif // XFA_SRC_FGAS_XML_FGAS_SAX_IMP_H_
diff --git a/xfa/src/fwl/basewidget/fwl_monthcalendarimp.h b/xfa/src/fwl/basewidget/fwl_monthcalendarimp.h
index 98b295ed6e..b2a21dc72a 100644
--- a/xfa/src/fwl/basewidget/fwl_monthcalendarimp.h
+++ b/xfa/src/fwl/basewidget/fwl_monthcalendarimp.h
@@ -7,7 +7,7 @@
#ifndef XFA_SRC_FWL_BASEWIDGET_FWL_MONTHCALENDARIMP_H_
#define XFA_SRC_FWL_BASEWIDGET_FWL_MONTHCALENDARIMP_H_
-#include "xfa/src/fgas/include/fx_datetime.h"
+#include "xfa/src/fgas/localization/fgas_datetime.h"
#include "xfa/src/fwl/core/fwl_widgetimp.h"
class CFWL_WidgetImpProperties;
diff --git a/xfa/src/fxfa/app/xfa_checksum.cpp b/xfa/src/fxfa/app/xfa_checksum.cpp
index 781a30f798..3df37cf156 100644
--- a/xfa/src/fxfa/app/xfa_checksum.cpp
+++ b/xfa/src/fxfa/app/xfa_checksum.cpp
@@ -7,7 +7,7 @@
#include "xfa/src/fxfa/app/xfa_checksum.h"
#include "core/include/fdrm/fx_crypt.h"
-#include "xfa/src/fgas/include/fx_alg.h"
+#include "xfa/src/fgas/crt/fgas_algorithm.h"
CXFA_SAXReaderHandler::CXFA_SAXReaderHandler(CXFA_ChecksumContext* pContext)
: m_pContext(pContext) {
diff --git a/xfa/src/fxfa/app/xfa_checksum.h b/xfa/src/fxfa/app/xfa_checksum.h
index a02ef311c6..fb004d37c1 100644
--- a/xfa/src/fxfa/app/xfa_checksum.h
+++ b/xfa/src/fxfa/app/xfa_checksum.h
@@ -8,7 +8,7 @@
#define XFA_SRC_FXFA_APP_XFA_CHECKSUM_H_
#include "xfa/include/fxfa/fxfa.h"
-#include "xfa/src/fgas/include/fx_sax.h"
+#include "xfa/src/fgas/xml/fgas_sax.h"
class CXFA_SAXReaderHandler;
class CXFA_ChecksumContext;
diff --git a/xfa/src/fxfa/app/xfa_ffapp.h b/xfa/src/fxfa/app/xfa_ffapp.h
index 4d4332aa5e..fc4b5e713d 100644
--- a/xfa/src/fxfa/app/xfa_ffapp.h
+++ b/xfa/src/fxfa/app/xfa_ffapp.h
@@ -12,7 +12,7 @@
#include "xfa/include/fwl/adapter/fwl_sdadapterimp.h"
#include "xfa/include/fwl/core/fwl_app.h"
#include "xfa/include/fxfa/fxfa.h"
-#include "xfa/src/fgas/include/fx_fnt.h"
+#include "xfa/src/fgas/font/fgas_font.h"
class CXFA_FWLAdapterWidgetMgr;
class CXFA_FWLTheme;
diff --git a/xfa/src/fxfa/app/xfa_ffdoc.cpp b/xfa/src/fxfa/app/xfa_ffdoc.cpp
index 1c277aad9d..78bb809b27 100644
--- a/xfa/src/fxfa/app/xfa_ffdoc.cpp
+++ b/xfa/src/fxfa/app/xfa_ffdoc.cpp
@@ -10,7 +10,7 @@
#include "core/include/fpdfdoc/fpdf_doc.h"
#include "core/include/fxcrt/fx_ext.h"
#include "xfa/include/fwl/core/fwl_note.h"
-#include "xfa/src/fgas/include/fx_alg.h"
+#include "xfa/src/fgas/crt/fgas_algorithm.h"
#include "xfa/src/fxfa/app/xfa_ffapp.h"
#include "xfa/src/fxfa/app/xfa_ffdocview.h"
#include "xfa/src/fxfa/app/xfa_ffnotify.h"
diff --git a/xfa/src/fxfa/app/xfa_fontmgr.h b/xfa/src/fxfa/app/xfa_fontmgr.h
index b8fa4ae31c..be3f7a74d8 100644
--- a/xfa/src/fxfa/app/xfa_fontmgr.h
+++ b/xfa/src/fxfa/app/xfa_fontmgr.h
@@ -12,7 +12,7 @@
#include "core/include/fxcrt/fx_ext.h"
#include "core/include/fxcrt/fx_system.h"
#include "xfa/include/fxfa/fxfa.h"
-#include "xfa/src/fgas/include/fx_fnt.h"
+#include "xfa/src/fgas/font/fgas_font.h"
struct XFA_FONTINFO {
FX_DWORD dwFontNameHash;
diff --git a/xfa/src/fxfa/app/xfa_fwltheme.cpp b/xfa/src/fxfa/app/xfa_fwltheme.cpp
index a97412cf0e..a56aa60628 100644
--- a/xfa/src/fxfa/app/xfa_fwltheme.cpp
+++ b/xfa/src/fxfa/app/xfa_fwltheme.cpp
@@ -18,7 +18,7 @@
#include "xfa/include/fwl/basewidget/fwl_pushbutton.h"
#include "xfa/include/fwl/basewidget/fwl_scrollbar.h"
#include "xfa/src/fdp/include/fde_tto.h"
-#include "xfa/src/fgas/include/fx_cpg.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
#include "xfa/src/fxfa/app/xfa_ffapp.h"
#include "xfa/src/fxfa/app/xfa_ffwidget.h"
diff --git a/xfa/src/fxfa/app/xfa_textlayout.cpp b/xfa/src/fxfa/app/xfa_textlayout.cpp
index 0ccb4e99d3..b59e8aac82 100644
--- a/xfa/src/fxfa/app/xfa_textlayout.cpp
+++ b/xfa/src/fxfa/app/xfa_textlayout.cpp
@@ -10,8 +10,8 @@
#include "core/include/fxcrt/fx_ext.h"
#include "xfa/src/fdp/include/fde_pen.h"
-#include "xfa/src/fgas/include/fx_alg.h"
-#include "xfa/src/fgas/include/fx_cpg.h"
+#include "xfa/src/fgas/crt/fgas_algorithm.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
#include "xfa/src/fxfa/app/xfa_ffapp.h"
#include "xfa/src/fxfa/app/xfa_ffdoc.h"
#include "xfa/src/fxfa/app/xfa_fontmgr.h"
diff --git a/xfa/src/fxfa/app/xfa_textlayout.h b/xfa/src/fxfa/app/xfa_textlayout.h
index c4ad1e138b..90d33737eb 100644
--- a/xfa/src/fxfa/app/xfa_textlayout.h
+++ b/xfa/src/fxfa/app/xfa_textlayout.h
@@ -10,7 +10,7 @@
#include "xfa/src/fdp/include/fde_brs.h"
#include "xfa/src/fdp/include/fde_css.h"
#include "xfa/src/fdp/include/fde_rdv.h"
-#include "xfa/src/fgas/include/fx_rbk.h"
+#include "xfa/src/fgas/layout/fgas_rtfbreak.h"
#include "xfa/src/fxfa/app/xfa_ffdoc.h"
#include "xfa/src/fxfa/parser/xfa_object.h"
diff --git a/xfa/src/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/src/fxfa/fm2js/xfa_fm2jscontext.cpp
index 2af975f888..c27223ac5c 100644
--- a/xfa/src/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/src/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -9,7 +9,7 @@
#include <time.h>
#include "core/include/fxcrt/fx_ext.h"
-#include "xfa/src/fgas/include/fx_locale.h"
+#include "xfa/src/fgas/localization/fgas_locale.h"
#include "xfa/src/fxfa/fm2js/xfa_fm2jsapi.h"
#include "xfa/src/fxfa/parser/xfa_document.h"
#include "xfa/src/fxfa/parser/xfa_localevalue.h"
diff --git a/xfa/src/fxfa/parser/xfa_basic_imp.cpp b/xfa/src/fxfa/parser/xfa_basic_imp.cpp
index dc4c8d1778..a0aa56d8be 100644
--- a/xfa/src/fxfa/parser/xfa_basic_imp.cpp
+++ b/xfa/src/fxfa/parser/xfa_basic_imp.cpp
@@ -7,9 +7,9 @@
#include "xfa/src/fxfa/parser/xfa_basic_imp.h"
#include "core/include/fxcrt/fx_ext.h"
-#include "xfa/src/fgas/include/fx_alg.h"
-#include "xfa/src/fgas/include/fx_cpg.h"
-#include "xfa/src/fgas/include/fx_sys.h"
+#include "xfa/src/fgas/crt/fgas_algorithm.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
+#include "xfa/src/fgas/crt/fgas_system.h"
#include "xfa/src/fxfa/fm2js/xfa_fm2jsapi.h"
#include "xfa/src/fxfa/parser/xfa_basic_data.h"
#include "xfa/src/fxfa/parser/xfa_docdata.h"
diff --git a/xfa/src/fxfa/parser/xfa_basic_imp.h b/xfa/src/fxfa/parser/xfa_basic_imp.h
index 55b3c1d4cb..562cf15909 100644
--- a/xfa/src/fxfa/parser/xfa_basic_imp.h
+++ b/xfa/src/fxfa/parser/xfa_basic_imp.h
@@ -8,7 +8,7 @@
#define XFA_SRC_FXFA_PARSER_XFA_BASIC_IMP_H_
#include "xfa/include/fxfa/fxfa_basic.h"
-#include "xfa/src/fgas/include/fx_stm.h"
+#include "xfa/src/fgas/crt/fgas_stream.h"
struct XFA_NOTSUREATTRIBUTE {
XFA_ELEMENT eElement;
diff --git a/xfa/src/fxfa/parser/xfa_document_serialize.cpp b/xfa/src/fxfa/parser/xfa_document_serialize.cpp
index 53f93f5f71..66a9b75e0c 100644
--- a/xfa/src/fxfa/parser/xfa_document_serialize.cpp
+++ b/xfa/src/fxfa/parser/xfa_document_serialize.cpp
@@ -6,7 +6,7 @@
#include "xfa/src/fxfa/parser/xfa_document_serialize.h"
-#include "xfa/src/fgas/include/fx_cpg.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
#include "xfa/src/fxfa/fm2js/xfa_fm2jsapi.h"
#include "xfa/src/fxfa/parser/xfa_docdata.h"
#include "xfa/src/fxfa/parser/xfa_doclayout.h"
diff --git a/xfa/src/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/src/fxfa/parser/xfa_layout_itemlayout.cpp
index 16fe2da8ac..cdf327826b 100644
--- a/xfa/src/fxfa/parser/xfa_layout_itemlayout.cpp
+++ b/xfa/src/fxfa/parser/xfa_layout_itemlayout.cpp
@@ -9,7 +9,7 @@
#include <algorithm>
#include <memory>
-#include "xfa/src/fgas/include/fx_alg.h"
+#include "xfa/src/fgas/crt/fgas_algorithm.h"
#include "xfa/src/fxfa/fm2js/xfa_fm2jsapi.h"
#include "xfa/src/fxfa/parser/xfa_docdata.h"
#include "xfa/src/fxfa/parser/xfa_doclayout.h"
diff --git a/xfa/src/fxfa/parser/xfa_locale.h b/xfa/src/fxfa/parser/xfa_locale.h
index 07953f290d..f4b128e67e 100644
--- a/xfa/src/fxfa/parser/xfa_locale.h
+++ b/xfa/src/fxfa/parser/xfa_locale.h
@@ -7,7 +7,7 @@
#ifndef XFA_SRC_FXFA_PARSER_XFA_LOCALE_H_
#define XFA_SRC_FXFA_PARSER_XFA_LOCALE_H_
-#include "xfa/src/fgas/include/fx_locale.h"
+#include "xfa/src/fgas/localization/fgas_locale.h"
#include "xfa/src/fxfa/parser/xfa_object.h"
class CXFA_XMLLocale : public IFX_Locale {
diff --git a/xfa/src/fxfa/parser/xfa_localemgr.h b/xfa/src/fxfa/parser/xfa_localemgr.h
index c76674c969..0af6f5f2d3 100644
--- a/xfa/src/fxfa/parser/xfa_localemgr.h
+++ b/xfa/src/fxfa/parser/xfa_localemgr.h
@@ -8,8 +8,8 @@
#define XFA_SRC_FXFA_PARSER_XFA_LOCALEMGR_H_
#include "xfa/include/fxfa/fxfa_objectacc.h"
-#include "xfa/src/fgas/include/fx_datetime.h"
-#include "xfa/src/fgas/include/fx_locale.h"
+#include "xfa/src/fgas/localization/fgas_datetime.h"
+#include "xfa/src/fgas/localization/fgas_locale.h"
#include "xfa/src/fxfa/parser/xfa_localemgr.h"
class CXFA_Node;
diff --git a/xfa/src/fxfa/parser/xfa_object_imp.cpp b/xfa/src/fxfa/parser/xfa_object_imp.cpp
index f2cea35ff4..23b0644074 100644
--- a/xfa/src/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/src/fxfa/parser/xfa_object_imp.cpp
@@ -7,8 +7,8 @@
#include "xfa/src/fxfa/parser/xfa_object.h"
#include "core/include/fxcrt/fx_ext.h"
-#include "xfa/src/fgas/include/fx_cpg.h"
-#include "xfa/src/fgas/include/fx_sys.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
+#include "xfa/src/fgas/crt/fgas_system.h"
#include "xfa/src/fxfa/fm2js/xfa_fm2jsapi.h"
#include "xfa/src/fxfa/parser/xfa_basic_imp.h"
#include "xfa/src/fxfa/parser/xfa_docdata.h"
diff --git a/xfa/src/fxfa/parser/xfa_parser_imp.cpp b/xfa/src/fxfa/parser/xfa_parser_imp.cpp
index fe90f004b2..a3d4f94089 100644
--- a/xfa/src/fxfa/parser/xfa_parser_imp.cpp
+++ b/xfa/src/fxfa/parser/xfa_parser_imp.cpp
@@ -6,7 +6,7 @@
#include "xfa/src/fxfa/parser/xfa_parser_imp.h"
-#include "xfa/src/fgas/include/fx_cpg.h"
+#include "xfa/src/fgas/crt/fgas_codepage.h"
#include "xfa/src/fxfa/fm2js/xfa_fm2jsapi.h"
#include "xfa/src/fxfa/parser/xfa_basic_imp.h"
#include "xfa/src/fxfa/parser/xfa_docdata.h"